Convert a String In C++ To Upper Case code example
Example 1: c++ char to uppercase
char choice;
// it will instantly transform it to upper case without the need
// to convert it to int first
choice = (char)toupper(choice);
Example 2: c++ convert lowercase to uppercase
/* toupper example */
#include <stdio.h>
#include <ctype.h>
int main ()
{
int i=0;
char str[]="Test String.\n";
char c;
while (str[i])
{
c=str[i];
putchar (toupper(c));
i++;
}
return 0;
}