Guest User

Untitled

a guest
Dec 15th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. std::string temp = "hello whats up";
  2.  
  3. string s("hello");
  4. cout << s.size() << ' ';
  5. s[1] = '';
  6. cout << s.size() << 'n';
  7.  
  8. std::string temp = "hello whats up";
  9.  
  10. std::string s1 = "abcd"; // s1 contains "ab", using string literal
  11. std::string s2{"abcd", 6}; // s2 contains "abcd", using different ctr
  12. std::string s3 = "abcd"s; // s3 contains "abcd", using ""s operator
Add Comment
Please, Sign In to add comment