what does std::endl represent exactly on each platform?

后端 未结 5 1262
孤独总比滥情好
孤独总比滥情好 2021-01-11 12:01

Thinking about UNIX, Windows and Mac and an output stream (both binary and text),

What does std::endl represent, i.e. ,

5条回答
  •  终归单人心
    2021-01-11 12:46

    The C++ standard says that it:

    Calls os.put(os.widen(’\n’) ), then os.flush()

    What the '\n' is converted to, if it is converted at all, is down to the stream type it is used on, plus any possible mode the stream may be opened in.

提交回复
热议问题