Hellfire103 to Programmer Humor@lemmy.mlEnglish • 1 month agoDoes this exist anywhere outside of C++?lemmy.mlimagemessage-square60fedilinkarrow-up11arrow-down10cross-posted to: programmer_humor@programming.dev
arrow-up11arrow-down1imageDoes this exist anywhere outside of C++?lemmy.mlHellfire103 to Programmer Humor@lemmy.mlEnglish • 1 month agomessage-square60fedilinkcross-posted to: programmer_humor@programming.dev
minus-square@allywilson@lemmy.mllinkfedilink0•1 month agoFrom memory it’s a way to declare a line ending after your string.
minus-square@SqueakyBeaver@lemmy.blahaj.zonelinkfedilink0•1 month agoAlternatively: https://en.cppreference.com/w/cpp/io/manip/endl p.s. The site isn’t entirely mobile friendly (I’m a cppref lover tbh)
minus-square@unlawfulbooger@lemmy.blahaj.zonelinkfedilink0•1 month agoBoy am I glad I don’t do C++ anymore. That string handling with the overloaded bitshift operator was wild.
minus-square@vapeloki@lemmy.worldlinkfedilink0•1 month agostd::endl is 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 preferred
minus-squarexigoilinkfedilinkEnglish0•1 month agoDon’t most terminals flush the buffer on newline anyway?
minus-square@ClemaX@lemm.eelinkfedilink0•1 month agoIt is the stream itself that is buffered, so the terminal does not handle the contents until the stream is flushed.
minus-square@vapeloki@lemmy.worldlinkfedilink0•1 month agoMaybe, but there is the internal buffer. Also, most I/O happens in files not consoles
minus-squareHellfire103OPlinkfedilinkEnglish0•edit-21 month agoInstead of this: cout << "Hello world.\n"; You can do this: cout << "Hello world." << endl;
minus-square@ReversalHatchery@beehaw.orglinkfedilinkEnglish0•1 month agosomething has replaced your lessthan signs with their HTML counterparts. such a silly thing to do in a code block
minus-square@fubbernuckin@lemmy.dbzer0.comlinkfedilinkEnglish0•1 month agoI think that’s client side. Doesn’t happen for me.
minus-square@Cyberfishofant2@lemm.eelinkfedilinkEnglish0•1 month agosame here. AP isn’t standardized enough, apparently
minus-square@Daedskin@lemm.eelinkfedilink0•1 month agoThe fact that you used the namespace for cout but not for endl inordinately bothers me
What the heck is endl???
God bless your soul.
From memory it’s a way to declare a line ending after your string.
https://cplusplus.com/reference/ostream/endl/
Alternatively:
https://en.cppreference.com/w/cpp/io/manip/endl
p.s. The site isn’t entirely mobile friendly
(I’m a cppref lover tbh)
Boy am I glad I don’t do C++ anymore. That string handling with the overloaded bitshift operator was wild.
Ah, so you’re a println! kinda guy?
🦀 🦀🦀🦀🦀🦀🦀🦀
std::endl
is 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?
It is the stream itself that is buffered, so the terminal does not handle the contents until the stream is flushed.
Maybe, but there is the internal buffer. Also, most I/O happens in files not consoles
Instead of this:
cout << "Hello world.\n";
You can do this:
cout << "Hello world." << endl;
something has replaced your lessthan signs with their HTML counterparts. such a silly thing to do in a code block
I think that’s client side. Doesn’t happen for me.
same here. AP isn’t standardized enough, apparently
The fact that you used the namespace for
cout
but not forendl
inordinately bothers me