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);
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);
uppercase capitalise character in string c++
str[i] = toupper(str[i]);
convert letters to uppercase in c++
#include <iostream>
#include <string>
using namespace std;
int main()
{
char letter;
cout << "You will be asked to enter a character.";
cout << "\nIf it is a lowercase character, it will be converted to uppercase.";
cout << "\n\nEnter a character. Press . to stop: ";
cin >> letter;
if(islower(letter))
{
letter = isupper(letter);
cout << letter;
}
while(letter != '.')
{
cout << "\n\nEnter a character. Press . to stop: ";
cin >> letter;
if(islower(letter))
{
letter = toupper(letter);
cout << letter;
}
}
return 0;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us