Does anyone know what algorithm or member function to use that returns a true or false if a container contains a specified item?
Something like:
if (contains(myVec,"John"))
cout<<"MyVec contains the name John!"<<endl;
Does anyone know what algorithm or member function to use that returns a true or false if a container contains a specified item?
Something like:
if (contains(myVec,"John"))
cout<<"MyVec contains the name John!"<<endl;
>if (contains(myVec,"John"))
Assuming your container can test for strings:
Code:if (find(myVec.begin(), myVec.end(), "John") != myVec.end())
p.s. What the alphabet would look like without q and r.