Breaking out of Infinite C++ loop in codeblock

时间:2018-02-03 10:23:13

标签: loops codeblocks

I am running a program written in C++ in Codeblocks in Windows. The major part of the program is structured like this:

while(true){
    // do and print something
    if (<something happens>)
        break;
    // do something
}

The problem is it takes a long time for the program to run in the windows cmd (which opens when I press the "build and run" option in Codeblocks). I would like to "stop" the output on the window and see the stuff that has been printed so far. How can I do the same? (If I press Ctrl + C, then it simply exits the window.)

1 个答案:

答案 0 :(得分:0)

With adding to pressing the pause button to stop command prompt, you could also extend the amount of viewable lines for future use.

More lines in command window