Write a C++ program that creates a CString (NULL terminated character array) of size 20 and initializes it with some words. Call this CString data[]. Now, reverse every word of the CString. Display...


Answer plz


Write a C++ program that creates a CString (NULL terminated character array) of size 20 and<br>initializes it with some words. Call this CString data[]. Now, reverse every word of the<br>CString. Display the CString before and after reverse.<br>Explanation:<br>Assume that the CString data[] is;<br>8 o o d boy 10 10 \0 \0<br>index 0 1 2 3 4 5 6 789 10 11 12 13 14 15 16 17 18 19<br>data<br>i s<br>He<br>a<br>Then the updated CString will be;<br>a doo 8 Yo b 0 10 10 10o<br>data e H<br>0 12 3 45 6 789 10 11 12 13 14 15 16 17 18 19<br>si<br>index<br>Note that we are updating the same original CString.<br>Expected Output:<br>Sample 1:<br>Before reverse data[] is :<br>After reverse data[] will be : eH si doog yob<br>He is good boy<br>Sample 2:<br>Before reverse data[] is :<br>After reverse data[] will be : eW era gnidaer koob<br>We are reading book<br>

Extracted text: Write a C++ program that creates a CString (NULL terminated character array) of size 20 and initializes it with some words. Call this CString data[]. Now, reverse every word of the CString. Display the CString before and after reverse. Explanation: Assume that the CString data[] is; 8 o o d boy 10 10 \0 \0 index 0 1 2 3 4 5 6 789 10 11 12 13 14 15 16 17 18 19 data i s He a Then the updated CString will be; a doo 8 Yo b 0 10 10 10o data e H 0 12 3 45 6 789 10 11 12 13 14 15 16 17 18 19 si index Note that we are updating the same original CString. Expected Output: Sample 1: Before reverse data[] is : After reverse data[] will be : eH si doog yob He is good boy Sample 2: Before reverse data[] is : After reverse data[] will be : eW era gnidaer koob We are reading book

Jun 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here