Question: In C++ Language: Consider the following statement: string str = Happy new years!; What is the output of the following statements? (Assume that all parts
In C++ Language:
Consider the following statement: string str = "Happy new years!"; What is the output of the following statements? (Assume that all parts are independent of each other.)
14. string::size_type ind = str.find('y'); string s = str.substr(ind, 4); cout << s << endl;
15. cout << str.insert(5, ", new") << endl;
16. str.erase(2, 12); str.insert(3, " a brand new car"); cout << str << endl;
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
