|
-
February 26th, 2006, 11:44 AM
#1
Matching a word in any element of a vector?
hello, i can match up a word in an specific element of a vector and then perform a action if all the elements match the specific word. the vector is called 'tokens'.
The problem is i want to able to go through a vector of any size and be able to match up one word (or more) to any element of the vector, then to perform the action.
for ( int i=0; i<tokens.size();i++)
{
if (tokens[i] == "MY" && tokens[i+1] =="NAME")
{
// then perform a action......
}
cout << myResponse << endl;
fileout << myResponse ;
}
thanks for anyhelp.
V
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|