changing character to uppercase c++ 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: convert whole string to uppercase c++
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s = "Viet Nam";
transform(s.begin(), s.end(), s.begin(), ::toupper); //uppercase
cout << s << endl;
return 0;
}