Switch to full style
C++ code examples
Post a reply

Convert To Upper Case in C++

Thu Nov 13, 2008 2:23 pm

Convert characters to upper case using C++
cpp code
/*
* Convert the input file to all upper case.
*/
#include <iostream>
#include <cctype>

using namespace std;

int main()
{
char inch; // Input character.

while(cin.get(inch)) {
if(isalpha(inch))
cout << (char)toupper(inch);
else
cout << inch;
}
}




Post a reply
  Related Posts  to : Convert To Upper Case in C++
 Change String to Upper case     -  
 Change letters to upper case by default     -  
 convert string to lower case     -  
 file exists in upper level folder link     -  
 Use the 'default' case     -  
 restrictions on the values of each case of a switch     -  
 How to Convert WMV to AVI on Mac     -  
 convert to binary number     -  
 convert XMLGregorianCalendar to GregorianCalendar     -  

Topic Tags

C++ Strings