Ctype.h header tolower function

Hi, I find it a chance to know about ctype.h header in c++ when we wanted to double check the y letter if it is lower or upper case.
The “tolower()” function included in ctype.h header could be useful to convert a string to lower case, hence my code would be something like:

getline(cin, response);
return (tolower(response[0]) == 'y');

Here is the documentation of the header used in classifying and transforming characters in a string: http://www.cplusplus.com/reference/cctype/

Privacy & Terms