c 2b 2b string initialization

Solutions on MaxInterview for c 2b 2b string initialization by the best coders in the world

showing results for - "c 2b 2b string initialization"
Alex
17 Apr 2017
1string s0;                                       // s0 = “”
2string s1(“Hello”);                               // s1 = “Hello”
3string s2 (s1);                                  // s2 = “Hello”
4string s3 (s1, 1, 2);                            // s3 = “el”
5string s4 ("Hello World", 5);                     // s4 = “Hello”
6string s5 (5, ‘*’);                              // s5 = “*****”
7string s6 (s1.begin(), s1.begin()+3);              // s6 = “Hel”