Unbuffered output with cout

后端 未结 1 1992
悲&欢浪女
悲&欢浪女 2020-12-03 07:55

How can you get unbuffered output from cout, so that it instantly writes to the console without the need to flush (similar to cerr)?

I thought it could be done throu

相关标签:
1条回答
  • 2020-12-03 08:36
    std::cout.setf(std::ios::unitbuf);
    

    Should do the trick.

    0 讨论(0)
提交回复
热议问题