Answer the question
In order to leave comments, you need to log in
How to implement gcc realtime output?
Let me explain the question with the simplest example.
Let's say I do a loop to display the percentage of completion in the console.
for (i = 0; i < n; i++)
{
if (i%(n/10) == 0) printf("%d ", i);
}
In Visual Studio, the percentage of completion is displayed in real time, in Code:Blocks under gcc on Unix, the result is displayed all immediately after the loop has completed. How to fix it?
Answer the question
In order to leave comments, you need to log in
If I understand your problem correctly, then you need to do fflush(stdout) after each printf
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question