In a 'for' loop the stop condition can be as simple or complex as you choose... although simpler is better. What you should be asking is 'why am I using a for loop here?'
A simple rule for using loops in C++ is:
If you have a known or preset number of iterations, use a 'for' loop. You might want to terminate early if you find a match, but you know what the upper bound is.
If you have a task to iterate an unknown number of times, and you might wish to skip the loop entirely, use a 'while' loop (tests on entry into loop)
If you have a task to iterate an unknown number of times, but you wish to execute it at least once, then use a do..while loop.
To answer your original question, you can use the old C functions strchr() or strcmp() defined in string.h. To reduce the number of tests, use the tolower() function to turn upper case into lower case prior to testing.
If you have access to a string class like the MFC CStringT you could do something pretty awful like concatenate all the inputs into a single string and then use the CString.Find() method to search for the occurence of a Q
Check out MSDN to see how it worksEdited by Stormwolf - 5/28/08 at 12:55pm