Question: C++ Help Write the following function: string frontBack(string str);//Given a string, return a new string where the first and last chars have been exchanged.//frontBack(code) rightarrow
C++ Help

Write the following function: string frontBack(string str);//Given a string, return a new string where the first and last chars have been exchanged.//frontBack("code") rightarrow "eodc"//frontBack("a") rightarrow "a"//frontBack("ab") rightarrow "ba
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
