Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- String s1 = "aaa";
- String s2("Hello");
- String s3(s2);
- String s4 = s1;
- String s5("a");
- String s6;
- s1 += s2;
- s2 = s3;
- s3 += s4;
- s4 = "NEU";
- cout << "1. expected: 'aaaHello' -- output : " << s1 << endl;
- cout << "2. expected: 'l' \t\t-- output : " << s2[ 2 ] << endl;
- cout << "3. expected: 'Hello' \t-- output : " << s2 << endl;
- cout << "4. expected: 'Helloaaa' -- output : " << s3 << endl;
- cout << "5. expected: 'NEU' \t\t-- output : " << s4 << endl;
- cout << "6. expected: 'a' \t\t-- output : " << s5 << endl;
- cout << "7. expected: '' \t\t-- output : " << s6 << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement