First, we can't see Passenger's declaration, so we're guessing.
Second, surround code with with code tags (hit the <> button on the right to see).
If survival is a std::string, then your check will work if the content is lower case.
If the content is mixed case or upper case, it won't work. You have to convert the string to lower case before the test.
Further, in any case, the content must be just those three letters, no spaces, no punctuation...exact match.
You can convert to lower case using the stl utility std::transform, with ::toupper.
1 2 3 4 5 6
|
std::string s = "UPPER or Mixed case";
std::transform( s.begin(), s.end(), s.begin(), ::toupper );
std::cout << s;
|
The output would be the lower case version of the string.
If survival is a character array, you'd have to use strcmp, or the safer strncmp, to compare strings.