Let's say I have a function
int pozvec(vector<string> vect)
which takes as parameter a pre-filled vector of strings.
I want to know at which position i
there is the character "p", specifically "p". All of the strings are single-character, but the vector is declared as containing strings. I want to save the index at which "p" is found in a variable x;
for(int i=0; i<vect.size(); i++)
if(vect[i] == "p")
x=i;
does not seem to work. Nor does strcmp, at all. The problem is more complex, but the part that doesn't work is this one.
Thank you in advance for your help!