Question: For the Rev Words option, create a C++ function, RevWordsInPlace , which has the prototype void RevWordsInPlace(char array[]); The function should reverse the words contained

For the RevWords option, create a C++ function, RevWordsInPlace, which has the prototype

 void RevWordsInPlace(char array[]); 

The function should reverse the words contained in array. The words in array are separated one from another by a space (' ') character, the first character of the first word is in array[0], and a newline (' ') character immediately follows the last character of the last word. The reversal must be done in-place, that is, no local (temporary) arrays should be used. You may use appropriate local variables for counting and indexing purposes.

Array Before Array After {one-word} {word-one}

{testing one two three} {three two one testing}

{Sam and Kate are happy} {happy are Kate and Sam}

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!