I am having problems with error checking. I want to ensure that the user puts in a name with characters and not use numbers. My thinking is that since player_name is data type char that using ( !player_name) should indicate not to input an int. any suggestions on how to go about this is greatly appreciated. thanks. I have no errors when compiling this but it doesn't work either.
void game::get_name()
{
cout << "Enter your name? ";
cin.getline(player_name, 50);
if(!player_name )
{
cout << "You must enter a name and not a number!" << "\n";
cout << "Enter your name? ";
cin.getline(player_name, 50);
}
}