fork download
  1. #include<string>
  2. #include<iostream>
  3. using namespace std;
  4.  
  5. int main ()
  6. {
  7. string s; // ASCII
  8. s += "!"; // 33
  9. s += "A"; // 65
  10. s += "a"; // 97
  11. s += "â"; // 131
  12. s += "ä"; // 132
  13. s += "à"; // 133
  14.  
  15. cout << s << endl; // Print directly
  16. for(auto i : s) // Print after iteration
  17. cout << i;
  18.  
  19. cout << "\ns.size() = " << s.size() << endl;
  20. }
  21.  
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
!Aaâäà
!Aaâäà
s.size() = 9