I would need a function that can convert a "char" variable from lowercase to uppercase after being entered. I know the function toupper () but I understand that it only works with character strings, and I just want to work with a variable.
Ex of what I want to do:
char tipo;
cout << "Tipo de consola (P = Portatil, M = De mesa): ";
cin >> tipo;
if( tipo != 'M' and tipo != 'P')
{
cout << "Tipo de consola invalido.";
return false;
}
Just as it works, as long as M or P is entered, but if "m" or "p" is entered the program bounces me. I do not want to add the lowercase letters to the "if" because otherwise it would be untidy.