4 ms·
> Use of '\n' is always better for printing new lines. Does this do the right thing on Windows?
by shadowfox 4y ago
> Use of '\n' is always better for printing new lines.
Does this do the right thing on Windows?
- afranchuk 4y agoYes! For the same reason it does the right thing in C APIs. Which many people don't realize (understandably) until they read the fine print in docs. If you read the specification of std::endl, it simply sends a "\n" and flushes.
- duped 4y agoUnless you explicitly set O_BINARY on stdout/stderr then LF is converted to CRLF, aka "text mode" vs "binary mode" for files.