Compile the program with:
Code:
g++ -g stringReplacements.cpp
Run it in a debugger:
Set a breakpoint with the
break command and the line number where you want the debugger to stop. Let's randomly say line 20:
Run the program until it gets to that point:
At this point you can use "n" to step over functions and "s" to step into them. Use "print" followed by a variable name to see its value.
When you're done, enter "quit" to exit the debugger. Or "run" to run either to the next breakpoint or the point where the program actually exits.
That should be enough to get started.