hi
can anyone tel me how to insert multiple data at once in a std::set using an +=operator?
i've created this function to insert a product into a set, but i don't know how to use an +=operator :-(
Code:
void grocery::insertProducts()
{
set <product> Prod;
string typeP, detalP, idP;
unsigned int costP;
cout<<"\n Type: ";
getline(cin,typeP);
fflush(stdin);
cout<<"\n Detailes: ";
getline(cin,detalP);
fflush(stdin);
cout<<"\n Cost: ";
cin>>costP;
cout<<"\n Product ID: ";
getline(cin,idP);
product insertProd(typeP, detalP, costP, idP);
Prod.insert(insertProd);
}
can anyone help?