When I was compiling a C++ program using Dev-C++5.11, I encountered an issue with incomplete output.
The code is as follows:
#include <iostream>
using namespace std;
int main() {
for (int i = 1; i <= 100; i++) {
cout << i << endl;
}
return 0;
}
I expect the program to output these 100 numbers, but the program only shows 75~100, and when I drag the scrollbar up there are many empty rows, but the numbers 1~74 do not appear. the output
The program runs on Windows11 and I can not find a solution.
Thanks to @Cody Gray, I realize that the problem may caused by limited console buffer size.
I can't find the correct way to change the buffer size in Windows Terminal. And I saw this artical Command Prompt and Windows Powershell for Windows 11.
I followed the Solution 2, and in Windows Console Host, the program can output correctly.