Confused on choices.

Hello everyone, I am currently programming a text - based game in c++. It is a fantasy/medieval RPG. Now you are able to set a class type, the three classes are Guard, Archer, or Mage. Now I have a string variable for it, but i also want to make it so i can do while loops with it.

Like this

string name;

cout << "Hello what is your name?: ";
cin >> name;

// But then i want to make a loop with it like

while (name == Bob)
{
statement;
}

while (name == Joe)
{
statement;
}

Is this possible to do? I am just learning, so please help! Thank you !

Takes the variable name and compares it to the variable Bob. Since you do not have a variable named Bob this will error. And you don't want to compare it to a variable anyway.... you want to compare it to the actual string data of "Bob".