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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!