to upper string c++ code example
Example 1: convert all characters in string to uppercase c++
transform(str.begin(), str.end(), str.begin(), ::toupper);
Example 2: uppercase capitalise character in string c++
str[i] = toupper(str[i]);
Example 3: convert from uppercase to lowercase c++
int i = 0;
while(str[i])
{
if(str[i] == std::toupper(str[i]) && std::isalpha(str[i]) == 1024)
str[i]+= 32;
++i;
}