This question already has an answer here:
I want to merge two containers of the same type. this is the structure of the classes. im getting the following error: /cygdrive/C/Users/USER/AppData/Roaming/NetBeans/8.1/bin/nativeexecution/dorun.sh: line 33: 4400 Segmentation fault (core dumped) sh "${SHFILE}" class Customer { int id; // customer id string name; // name };
class Purchase {
string n; // name of product
double up; // unit price
int c;
};
class Order {
Customer c;
vector<Purchase> p;
};
...
...
...
//main
list<Orderer> mylist{};
vector<Order>myvec{};
vector<Order>mergedvec{};
merge(mylist.begin(),mylist.end(),myvec.begin(),myvec.end(),mergedvec.begin());
Aucun commentaire:
Enregistrer un commentaire