Hellfire103@lemmy.ca to Programmer Humor@lemmy.mlEnglish · 2 months agoDoes this exist anywhere outside of C++?lemmy.mlimagemessage-square58linkfedilinkarrow-up1167cross-posted to: programmer_humor@programming.dev
arrow-up1167imageDoes this exist anywhere outside of C++?lemmy.mlHellfire103@lemmy.ca to Programmer Humor@lemmy.mlEnglish · 2 months agomessage-square58linkfedilinkcross-posted to: programmer_humor@programming.dev
minus-squarevapeloki@lemmy.worldlinkfedilinkarrow-up39·2 months 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-squareHellfire103@lemmy.caOPlinkfedilinkEnglisharrow-up10·edit-22 months agoInstead of this: cout << "Hello world.\n"; You can do this: cout << "Hello world." << endl;
minus-squareDaedskin@lemm.eelinkfedilinkarrow-up6·2 months agoThe fact that you used the namespace for cout but not for endl inordinately bothers me
minus-squareReversalHatchery@beehaw.orglinkfedilinkEnglisharrow-up1·2 months agosomething has replaced your lessthan signs with their HTML counterparts. such a silly thing to do in a code block
minus-squarefubbernuckin@lemmy.dbzer0.comlinkfedilinkEnglisharrow-up3·2 months agoI think that’s client side. Doesn’t happen for me.
minus-squareCyberfishofant2@lemm.eelinkfedilinkEnglisharrow-up1·2 months agosame here. AP isn’t standardized enough, apparently
minus-squareReversalHatchery@beehaw.orglinkfedilinkEnglisharrow-up1·edit-22 months agonah its a lemmy app on android that didn’t get an update in ages. probably just uses a faulty markdown renderer
minus-squaregon [he]@lemm.eelinkfedilinkEnglisharrow-up7·2 months agohttps://cplusplus.com/reference/ostream/endl/
minus-squareunlawfulboogerlinkfedilinkarrow-up11·2 months agoBoy am I glad I don’t do C++ anymore. That string handling with the overloaded bitshift operator was wild.
minus-squarevext01@lemmy.sdf.orglinkfedilinkarrow-up1·2 months agoAh, so you’re a println! kinda guy?
minus-squareSqueakyBeaverlinkfedilinkarrow-up2·2 months 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-squareallywilson@lemmy.mllinkfedilinkarrow-up3·2 months agoFrom memory it’s a way to declare a line ending after your string.
What the heck is endl???
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 preferredInstead of this:
You can do this:
The fact that you used the namespace for
cout
but not forendl
inordinately bothers mesomething 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
nah its a lemmy app on android that didn’t get an update in ages. probably just uses a faulty markdown renderer
https://cplusplus.com/reference/ostream/endl/
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?
🦀 🦀🦀🦀🦀🦀🦀🦀
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)
From memory it’s a way to declare a line ending after your string.
God bless your soul.