string gender;
do {
cout << "Is your player male (enter 'he') or female (enter 'she')?" << endl;
cin >> gender;
// loop until gender is either "he" or "she"
} while( gender != "he" && gender != "she" );
cout << "Is your player male (enter 'he') or female (enter 'she')?" << endl;
string gender;
cin >> gender;
// I'm trying to test whether the user entered he or she.
while (gender==//WHAT SHOULD I PUT HERE?)
do {
}
isnt it as simple to find what the user entered as:
1 2 3 4 5 6
string gender;
cout << "Is your player male (enter 'he') or female (enter 'she')?" << endl;
getline (cin,gender);
cout << "The user entered " << gender << " for their selection." << endl;