toupper()

Declaration

int toupper(int iChar);

Description:

This function converts a lowercase character ['a', 'z'] to the corresponding uppercase character ['A', 'Z'] in the ASCII table.

Example

#include <iostream>
#include <cctype>

int main() {
    using namespace std;

    int iChar = (int)'t';
    cout << "The original character was " << (char)iChar << " with ASCII value " << iChar << endl;
    iChar = toupper(iChar);
    cout << "The converted character is " << (char)iChar << " with ASCII value " << iChar << endl;

    return 0;
}

Output:

toupper() Output