Unbuffered output with cout

后端 未结 1 2011
悲&欢浪女
悲&欢浪女 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)
提交回复
热议问题