Mega Code Archive

 
Categories / C++ Tutorial / Data Types
 

Toupper and tolower

#include <iostream> using std::cout; using std::endl; #include <cctype> using std::islower; using std::isupper; using std::tolower; using std::toupper; int main() {    cout << "\nu converted to uppercase is "        << static_cast< char >( toupper( 'u' ) )       << "\n7 converted to uppercase is "        << static_cast< char >( toupper( '7' ) )        << "\n$ converted to uppercase is "        << static_cast< char >( toupper( '$' ) )        << "\nL converted to lowercase is "        << static_cast< char >( tolower( 'L' ) ) << endl;    return 0; } u converted to uppercase is U 7 converted to uppercase is 7 $ converted to uppercase is $ L converted to lowercase is l