Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a C++ function that will reverse the characters in a C++ string. - The fun

ID: 3574116 • Letter: W

Question

Write a C++ function that will reverse the characters in a

                                                C++ string.

                                                - The function prototype is:

                                                                  void reverse( char word[] )

Note:   - The function can not have any work arrays, i.e.,

                                                              the function cannot have any local variables that

                                                              are arrays.

                                               Note:   - An Algorithm is outlined below:

                                                                 - have 2 subscripts left and right

                                                                 - find the '' in the array and set

                                                                            right to be one less than the

                                                                            subscript where the '' is located

                                                                 - set left to 0

                                                                 - set up a while loop

                                                                 - inside the while loop switch word[left]

                                                                        with word[right] - you will need a

                                                                        work char variable for the swith

                                                                 - move left up by 1 and move right down by 1

Explanation / Answer

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote