// // Recursive program to print a string in reverse. // The program has a bug that causes it to enter an infinite // recursive loop and eventually blow the stack. // Where is the problem and how can it be fixed? // Hint: You may want to run the program through the debugger // for a few steps and see what happens to s. #include using namespace std; void reverse (char * s) // { if (*s = '\0') return; else { reverse (s+1); cout << *s; } } main() { char word[] = "string"; reverse(word); cout << endl; }