Question: PROBLEM 1 (a) Write a declaration to store the string This is a test in an array named char strtest [ 14 ] . Then

 PROBLEM 1 (a) Write a declaration to store the string "This

PROBLEM 1 (a) Write a declaration to store the string "This is a test" in an array named char strtest [ 14 ] . Then write a for statement to display the string in reverse order: tset a si sihT" (b) Write a while loop to display the string as stored. The expression while (str test [i] != ' \0' ) can be used. [5 points] 5 points] (c) Write a for statement to display only the array elements t, e, s, andt. 5 points] e) Define a vector of strings using the atrteat [) aray using the statement vector strvec (strtest, strtest+14) . Rewrite the C++ code fragment in part (a) above using vector class and functions specified in Table 7.2 of Bronson text. Include necessary libraries. You may use the vector functions: strvec.size, strvec.begin, strvec.end O, strvec.at (index), etc. [10 points]

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!