In my program, when the user is prompted for an employee's name, the system prompts him to re-enter his name if he enters a number or only a space. How do I put a requirement decision in parentheses in a while loop, here's my code.
std::string NAME;
std::cout << "Please enter the name: " << std::endl;
std::cin >> NAME;
while (NAME.length() == 0) {
std::cout << "Your input is not correct. Please re-enter your name" << std::endl;
std::cin >> NAME;
}
I'm only going to restrict the input to not being empty, but I don't know how to get the user to only allow characters to enter.
Thank you all.