C Standard Libraries C++

tolower()

Declaration

int tolower(int iChar);

Description

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

Example

#include <iostream>
#include <cctype>

int main() {
    using namespace std;

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

    return 0;
}

Output

tolower() Output
 

© 2007–2024 XoaX.net LLC. All rights reserved.