![]() |
Data Abstraction and Problem Solving with C++Walls and Mirrorsby Frank M. Carrano |
![]() |
c02p079.cppGo to the documentation of this file.00001 00022 void writeBackward(string s, int size) 00023 { 00024 if (size > 0) 00025 { // write the last character 00026 cout << s.substr(size-1, 1); 00027 00028 // write the rest of the string backward 00029 writeBackward(s, size-1); // Point A 00030 } // end if 00031 00032 // size == 0 is the base case - do nothing 00033 } // end writeBackward |