Suppose I define std::vector<std::string> names
and I declare
names[0] = "John";
names[1] = "Patrick";
names[2] = "Carol";
names[3] = "Jessica";
Is there a method I can use to get the index of a certain name, e.g. names.gettheindex("John")
would return the index 0
?