Which method do we use to append more than one character at a time?
What is the output of this program?
1. #include2. #include 3. using namespace std; 4. int main () 5. { 6. string str ("Ubuntu"); 7. cout << str.capacity(); 8. cout << str.max_size(); 9. return 0; 10. }
What is the output of this program?
1. #include2. #include 3. using namespace std; 4. int main () 5. { 6. string str ("Microsoft"); 7. for (size_t i = 0; i < str.length();) 8. { 9. cout << str.at(i-1); 10. } 11. return 0; 12. }
What is the output of this program?
1. #include2. #include 3. using namespace std; 4. int main () 5. { 6. string str ("steve jobs is legend"); 7. string::iterator it; 8. str.erase (str.begin()+ 5, str.end()-7); 9. cout << str << endl; 10. return 0; 11. }
What is the output of this program?
1. #include2. #include 3. using namespace std; 4. int main () 5. { 6. string str ("nobody does like this"); 7. string key ("nobody"); 8. size_t f; 9. f = str.rfind(key); 10. if (f != string::npos) 11. str.replace (f, key.length(), "everybody"); 12. cout << str << endl; 13. return 0; 14. }