fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <cctype>
  4.  
  5. void toLowercase(std::string& s) {
  6. for(int i = 0; i < s.length(); i++)
  7. s[i] = tolower(s[i]);
  8. }
  9. int main() {
  10. std::string hello = "HELLO WORLD";
  11. toLowercase(hello);
  12. std::cout << hello;
  13. }
Success #stdin #stdout 0.01s 2856KB
stdin
Standard input is empty
stdout
hello world