After I build a program, and run it, the console stays empty, while it's waiting for my scanf prompts, after pressing "Enter" on the console window in Eclipse, everything prints out, almost as if the whole buffer is being saved somewhere and then printed out. Is there a way to show the output on the console as it's being printed, and not wait until the end of execution to print everything?

有帮助吗?

解决方案

try this line fflush(stdout); after ther first output printf statement...this will work fine

read this post as a reference: https://bugs.eclipse.org/bugs/show_bug.cgi?id=173732

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top