When I run my program in VS2010, because my output quite a lot,the console just discards my previous output.
For example, consider my output to be of 400 lines, line
Right before your output. You can set it dynamically based on output but be sure to remember that if a line is longer than the width you will have additional lines to contend with.