this post was submitted on 05 Apr 2025
163 points (96.0% liked)
Programmer Humor
35334 readers
1 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
What the heck is endl???
std::endlis used in output streams in C++ to end the line, using the os specific line termination sequence, and flush the buffer.The later one is a performance issue in many cases, why the use of
"\n"is considered preferredDon’t most terminals flush the buffer on newline anyway?
Maybe, but there is the internal buffer. Also, most I/O happens in files not consoles