How to use bool efficiently

How am I able to input any name into my bool, but only one name can be true.

Here's my code below so far.

int main()
{

bool a;

cout << "Enter the users real name:";
cin >> a;

if (a == true)
{
cout << "That is the right name.";
}

else if (a == false)
{
cout << "Incorrect name.";
}
}
How am I able to input any name into my bool


You can't; a bool can hold only two values. true and false.

If you want a variable that can hold anything you type in, you're looking for a string; not a bool
Thank you!
Topic archived. No new replies allowed.