S
solartimba
If I have a class like:
class cExample
{
private:
string name;
int id;
}
and I have a vector of these objects vector<cExample> v.
How do I use find() to get a particular id? (I know maps are better at
this but I need to use a vector)
This wouldn't work, right? vIter=find(v.begin(),v.end(),4);
class cExample
{
private:
string name;
int id;
}
and I have a vector of these objects vector<cExample> v.
How do I use find() to get a particular id? (I know maps are better at
this but I need to use a vector)
This wouldn't work, right? vIter=find(v.begin(),v.end(),4);