Question: Consider the following statement: string str = Now is the time for the party!; What is the output of the following statements? (Assume that
Consider the following statement: string str = "Now is the time for the party!"; What is the output of the following statements? (Assume that all parts are independent of each other.) a. b. cout < < str.size() < < endl; cout < < str.substr(7, 8) < < endl; C. string: :size_type ind = str.find('f'); string s= str.substr(ind + 4, 9); cout < < s < < endl; cout < < str.insert (11, "best ") < < endl; d. e. str.erase (16, 14); str.insert (16, "to study for the exam? "); cout < < str < < endl; Consider the following statement: string str = "Now is the time for the party!"; What is the output of the following statements? (Assume that all parts are independent of each other.) a. b. C. cout < < str.size() < < endl; cout < < str.substr(7, 8) < < endl; string: :size_type ind = str.find('f'); string s = str.substr(ind + 4, 9); cout < < s < < endl; cout < < str.insert (11, "best ") < < endl; d. e. str.erase (16, 14); str.insert (16, "to study for the exam? "); cout < < str < < endl;
Step by Step Solution
There are 3 Steps involved in it
The image appears to be a set of C code snippets involving different operations on a string The variable str is initialized with the string Now is the ... View full answer
Get step-by-step solutions from verified subject matter experts
