tolower() operates on a single character at a time. Also it leaves the parameter unchanged, you need to make use of the value returned by the function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <algorithm>
#include <iostream>
#include <string>
int main()
{
std::string a = "Hello World";
for (char & ch : a)
ch = tolower(ch);
std::cout << a << '\n';
std::transform(a.begin(), a.end(), a.begin(), toupper);
std::cout << a << '\n';
}