Given string foo, I\'ve written answers on how to use cctype\'s tolower to convert the characters to lowercase
transform(cbegin(foo
In the first case (cctype) the locale is set implicitely:
Converts the given character to lowercase according to the character conversion rules defined by the currently installed C locale.
http://en.cppreference.com/w/cpp/string/byte/tolower
In the second (locale's) case you have to explicitely set the locale:
Converts parameter c to its lowercase equivalent if c is an uppercase letter and has a lowercase equivalent, as determined by the ctype facet of locale loc. If no such conversion is possible, the value returned is c unchanged.
http://www.cplusplus.com/reference/locale/tolower/