Search a product using STD::SET find()
hi, i'm trying to find a product using .find(), but it doesn't work :-(
cout<<"Product ID: ";
set <product>::const_iterator it;
if( Prod.find(id) == Prod.end() ) //set <product> Prod; is inside the grocery.h
else cout<<"\nthe product type is: "<<it->getType() <<"\n";
i know the product was inserted because after insertion, i view all products to be certain.
can anyone tel me what i'm doing wrong?