if *s is in the vector *v,how can I sure the index of s element in the vector *v. vector element: "a","b","c","Iamin","d","f". I want to get the position of "Iamin",if there are concrete function,that will be good!
Thanks...qingwu<br />When I open my eyes,I see your pretty face.
posted 14 years ago
U can do that with the indexOf method... The return type is an integer, giving u the 'first' occurence of the object. If 'v' is yr vector and 's' is the string u want to look for- int i=0; i = v.indexOf(s); i is yr index.... If the object is not found, -1 is returned