No console output on cout

前端 未结 7 2075
情歌与酒
情歌与酒 2020-12-19 06:11

Good morning,

I have a problem with Eclipse IDE for C/C++ Developers.

I\'m writting a smal tool for converting Strings. While testing on some point e

7条回答
  •  北海茫月
    2020-12-19 06:31

    You need to end output strings with newline, e.g.: `cout << "test\n"``. The reason is that the standard output is buffered and the buffer is flushed on newline. There probably exists a way to flush the cout buffer without outputting a newline, but I don't know it by heart. Probably includes access to the underlying streambuf (via the rdbuf method).

提交回复
热议问题