tolower() Function in C++ Last Updated : 11 Mar, 2023 Comments Improve Suggest changes Like Article Like Report The C++ tolower() function converts an uppercase alphabet to a lowercase alphabet. It is a predefined function of ctype.h header file. If the character passed is an uppercase alphabet, then the tolower() function converts an uppercase alphabet to a lowercase alphabet. This function does not affect another lowercase character, special symbol, or digit. int tolower(int ch); Parameter: ch: It is the character to be converted to lowercase. Return Value: This function returns the ASCII value of the lowercase character corresponding to the ch. In C++, typecasting of int to char is done as follows: char c = (char) tolower('A'); Below programs illustrate the tolower() function in C++: Example 1: C++ // C++ program to demonstrate // example of tolower() function. #include <iostream> using namespace std; int main() { char c = 'G'; cout << c << " in lowercase is represented as = "; // tolower() returns an int value there for typecasting // with char is required cout << (char)tolower(c); } OutputG in lowercase is represented as = g Example 2: C++ // C++ program to convert a string to lowercase // using tolower #include <bits/stdc++.h> using namespace std; int main() { // string to be converted to lowercase string s = "GEEKSFORGEEKS"; for (auto& x : s) { x = tolower(x); } cout << s; return 0; } Outputgeeksforgeeks Note: If the character passed in the tolower() is any of these three lowercase characterspecial symboldigit tolower() will return the character as it is. Example 3: C++ // C++ program to demonstrate // example of tolower() function. #include <iostream> using namespace std; int main() { string s="Geeks@123"; for(auto x:s){ cout << (char)tolower(x); } return 0; } Outputgeeks@123 Comment More infoAdvertise with us Next Article tolower() Function in C++ bansal_rtk_ Follow Improve Article Tags : Misc C++ cpp-string CPP-Functions Practice Tags : CPPMisc Similar Reads towlower() function in C/C++ The towlower() is a built-in function in C/C++ which converts the given wide character into lowercase. It is defined within the cwctype header file of C++. It is a function in header file , so it is mandatory to use this header file if using this functionIt is the wide-character equivalent of the to 2 min read toupper() function in C The toupper() function is used to convert lowercase alphabet to uppercase. i.e. If the character passed is a lowercase alphabet then the toupper() function converts a lowercase alphabet to an uppercase alphabet. It is defined in the ctype.h header file.Syntax: int toupper(int ch);Parameter: It accep 2 min read strol() function in C++ The strtol() function in C++ interprets the contents of a string as an integral number of the specified base and return its value as a long int.This function also sets an end pointer that points to the first character after the last valid numeric character of the string, if there is no such characte 3 min read towupper() function in C/C++ The towupper() is a built-in function in C/C++ which converts the given wide character into uppercase. It is defined within the cwctype header file of C++. Syntax: wint_t towupper( wint_t ch ) Parameter: The function accepts a single mandatory parameter ch which specifies the wide character which we 2 min read log() Function in C++ The std::log() in C++ is a built-in function that is used to calculate the natural logarithm (base e) of a given number. The number can be of any data type i.e. int, double, float, long long. It is defined inside the <cmath> header file.In this article we will learn about how to use std::log() 1 min read Function Pointer in C++ Prerequisites: Pointers in C++Function in C++ Pointers are symbolic representations of addresses. They enable programs to simulate call-by-reference as well as to create and manipulate dynamic data structures. Iterating over elements in arrays or other data structures is one of the main use of point 4 min read std::function in C++ The std::function() in C++ is a function wrapper class which can store and call any function or a callable object. In this article, we will learn about std::function in C++ and how to use it in different cases.Table of ContentWhat is std::function in C++?Example of std::functionMember Functions of s 5 min read wcschr() function in C++ wcschr() function in C++ searches for the first occurrence of a wide character in a wide string. The terminating null wide character is considered part of the string. Therefore, it can also be located in order to retrieve a pointer to the end of a wide string. Syntax: const wchar_t* wcschr (const wc 2 min read strupr() function in c The strupr( ) function is used to converts a given string to uppercase. Syntax: char *strupr(char *str); Parameter: str: This represents the given string which we want to convert into uppercase. Returns: It returns the modified string obtained after converting the characters of the given string str 1 min read towctrans() function in C/C++ The towctrans() is a built-in function in C/C++ which applies a transformation to the wide character wc specified by desc. It is defined within the cwctype header file of C/C++. Syntax: wint_t towctrans(wint_t wc, wctype_t desc) Parameter: The function accepts two mandatory parameter which are descr 2 min read Like