Clion Debug模式输出顺序问题

Windows,Clion在debug的时候,printf不会实时输出,在程序结束后才会输出。

解决:在程序开始时候禁用缓冲区:setbuf(stdout, 0);

1
setbuf(stdout, 0);