On Tue, Feb 2, 2010 at 8:20 PM, dan hitt <dan.hitt@xxxxxxxxx> wrote: > Peng ---- you must be aware of gdb? So you probably have to > compile with the -g flag set. > > I'm not sure if you can set gdb to do the printing the > way you suggest, but it is the first thing to consider, > i think ??? I know gdb, But I don't want to enter the interactive mode. I want the program runs until it finishes without needing my intervention. In interactive language such as R, both the source code along with the output can be printed to stdout. This improves the productivity, because I don't have to explicitly print anything to see where the program run. If C++ has this capability, the programmer productive in C++ can be improved.