fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <locale>
  4.  
  5. int main()
  6. {
  7. std::string str = "I am a string";
  8. std::use_facet< std::ctype<char> >(std::locale()).toupper(&str[0], &str[0] + str.size());
  9. std::cout << str << '\n';
  10. }
  11.  
Success #stdin #stdout 0s 3028KB
stdin
Standard input is empty
stdout
I AM A STRING