▲ 169 ▼ Does this exist anywhere outside of C++? (lemmy.ml) submitted 1 year ago by hellfire103@lemmy.ca to c/programmerhumor@lemmy.ml 61 comments fedilink hide all child comments
[–] unlawfulbooger@lemmy.blahaj.zone 17 points 1 year ago (5 children) What the heck is endl??? permalink fedilink source hideshow 10 child comments replies: [–] vapeloki@lemmy.world 40 points 1 year ago (1 child) 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 preferred permalink fedilink source parent hideshow 2 child comments replies: [–] xigoi@lemmy.sdf.org 2 points 1 year ago (2 children) Don’t most terminals flush the buffer on newline anyway? permalink fedilink source parent hideshow 4 child comments replies: [–] ClemaX@lemm.ee 8 points 1 year ago It is the stream itself that is buffered, so the terminal does not handle the contents until the stream is flushed. permalink fedilink source parent [–] vapeloki@lemmy.world 2 points 1 year ago Maybe, but there is the internal buffer. Also, most I/O happens in files not consoles permalink fedilink source parent [–] hellfire103@lemmy.ca [S] 10 points 1 year ago* (2 children) Instead of this: cout << "Hello world.\n"; You can do this: cout << "Hello world." << endl; permalink fedilink source parent hideshow 4 child comments replies: [–] Daedskin@lemm.ee 6 points 1 year ago The fact that you used the namespace for cout but not for endl inordinately bothers me permalink fedilink source parent [–] ReversalHatchery@beehaw.org 1 point 1 year ago (1 child) something has replaced your lessthan signs with their HTML counterparts. such a silly thing to do in a code block permalink fedilink source parent hideshow 2 child comments replies: [–] fubbernuckin@lemmy.dbzer0.com 3 points 1 year ago (1 child) I think that's client side. Doesn't happen for me. permalink fedilink source parent hideshow 2 child comments replies: [–] Cyberfishofant2@lemm.ee 1 point 1 year ago (1 child) same here. AP isn't standardized enough, apparently permalink fedilink source parent hideshow 2 child comments replies: [–] ReversalHatchery@beehaw.org 1 point 1 year ago* nah its a lemmy app on android that didn't get an update in ages. probably just uses a faulty markdown renderer permalink fedilink source parent [–] gon@lemm.ee 7 points 1 year ago (2 children) https://cplusplus.com/reference/ostream/endl/ permalink fedilink source parent hideshow 4 child comments replies: [–] unlawfulbooger@lemmy.blahaj.zone 11 points 1 year ago (1 child) Boy am I glad I don’t do C++ anymore. That string handling with the overloaded bitshift operator was wild. permalink fedilink source parent hideshow 2 child comments replies: [–] vext01@lemmy.sdf.org 1 point 1 year ago (1 child) Ah, so you're a println! kinda guy? permalink fedilink source parent hideshow 2 child comments replies: [–] unlawfulbooger@lemmy.blahaj.zone 2 points 1 year ago 🦀 🦀🦀🦀🦀🦀🦀🦀 permalink fedilink source parent [–] SqueakyBeaver@lemmy.blahaj.zone 2 points 1 year ago 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) permalink fedilink source parent [–] allywilson@lemmy.ml 3 points 1 year ago From memory it's a way to declare a line ending after your string. permalink fedilink source parent [–] jaybone@lemmy.zip 2 points 1 year ago God bless your soul. permalink fedilink source parent
[–] vapeloki@lemmy.world 40 points 1 year ago (1 child) 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 preferred permalink fedilink source parent hideshow 2 child comments replies: [–] xigoi@lemmy.sdf.org 2 points 1 year ago (2 children) Don’t most terminals flush the buffer on newline anyway? permalink fedilink source parent hideshow 4 child comments replies: [–] ClemaX@lemm.ee 8 points 1 year ago It is the stream itself that is buffered, so the terminal does not handle the contents until the stream is flushed. permalink fedilink source parent [–] vapeloki@lemmy.world 2 points 1 year ago Maybe, but there is the internal buffer. Also, most I/O happens in files not consoles permalink fedilink source parent
[–] xigoi@lemmy.sdf.org 2 points 1 year ago (2 children) Don’t most terminals flush the buffer on newline anyway? permalink fedilink source parent hideshow 4 child comments replies: [–] ClemaX@lemm.ee 8 points 1 year ago It is the stream itself that is buffered, so the terminal does not handle the contents until the stream is flushed. permalink fedilink source parent [–] vapeloki@lemmy.world 2 points 1 year ago Maybe, but there is the internal buffer. Also, most I/O happens in files not consoles permalink fedilink source parent
[–] ClemaX@lemm.ee 8 points 1 year ago It is the stream itself that is buffered, so the terminal does not handle the contents until the stream is flushed. permalink fedilink source parent
[–] vapeloki@lemmy.world 2 points 1 year ago Maybe, but there is the internal buffer. Also, most I/O happens in files not consoles permalink fedilink source parent
[–] hellfire103@lemmy.ca [S] 10 points 1 year ago* (2 children) Instead of this: cout << "Hello world.\n"; You can do this: cout << "Hello world." << endl; permalink fedilink source parent hideshow 4 child comments replies: [–] Daedskin@lemm.ee 6 points 1 year ago The fact that you used the namespace for cout but not for endl inordinately bothers me permalink fedilink source parent [–] ReversalHatchery@beehaw.org 1 point 1 year ago (1 child) something has replaced your lessthan signs with their HTML counterparts. such a silly thing to do in a code block permalink fedilink source parent hideshow 2 child comments replies: [–] fubbernuckin@lemmy.dbzer0.com 3 points 1 year ago (1 child) I think that's client side. Doesn't happen for me. permalink fedilink source parent hideshow 2 child comments replies: [–] Cyberfishofant2@lemm.ee 1 point 1 year ago (1 child) same here. AP isn't standardized enough, apparently permalink fedilink source parent hideshow 2 child comments replies: [–] ReversalHatchery@beehaw.org 1 point 1 year ago* nah its a lemmy app on android that didn't get an update in ages. probably just uses a faulty markdown renderer permalink fedilink source parent
[–] Daedskin@lemm.ee 6 points 1 year ago The fact that you used the namespace for cout but not for endl inordinately bothers me permalink fedilink source parent
[–] ReversalHatchery@beehaw.org 1 point 1 year ago (1 child) something has replaced your lessthan signs with their HTML counterparts. such a silly thing to do in a code block permalink fedilink source parent hideshow 2 child comments replies: [–] fubbernuckin@lemmy.dbzer0.com 3 points 1 year ago (1 child) I think that's client side. Doesn't happen for me. permalink fedilink source parent hideshow 2 child comments replies: [–] Cyberfishofant2@lemm.ee 1 point 1 year ago (1 child) same here. AP isn't standardized enough, apparently permalink fedilink source parent hideshow 2 child comments replies: [–] ReversalHatchery@beehaw.org 1 point 1 year ago* nah its a lemmy app on android that didn't get an update in ages. probably just uses a faulty markdown renderer permalink fedilink source parent
[–] fubbernuckin@lemmy.dbzer0.com 3 points 1 year ago (1 child) I think that's client side. Doesn't happen for me. permalink fedilink source parent hideshow 2 child comments replies: [–] Cyberfishofant2@lemm.ee 1 point 1 year ago (1 child) same here. AP isn't standardized enough, apparently permalink fedilink source parent hideshow 2 child comments replies: [–] ReversalHatchery@beehaw.org 1 point 1 year ago* nah its a lemmy app on android that didn't get an update in ages. probably just uses a faulty markdown renderer permalink fedilink source parent
[–] Cyberfishofant2@lemm.ee 1 point 1 year ago (1 child) same here. AP isn't standardized enough, apparently permalink fedilink source parent hideshow 2 child comments replies: [–] ReversalHatchery@beehaw.org 1 point 1 year ago* nah its a lemmy app on android that didn't get an update in ages. probably just uses a faulty markdown renderer permalink fedilink source parent
[–] ReversalHatchery@beehaw.org 1 point 1 year ago* nah its a lemmy app on android that didn't get an update in ages. probably just uses a faulty markdown renderer permalink fedilink source parent
[–] gon@lemm.ee 7 points 1 year ago (2 children) https://cplusplus.com/reference/ostream/endl/ permalink fedilink source parent hideshow 4 child comments replies: [–] unlawfulbooger@lemmy.blahaj.zone 11 points 1 year ago (1 child) Boy am I glad I don’t do C++ anymore. That string handling with the overloaded bitshift operator was wild. permalink fedilink source parent hideshow 2 child comments replies: [–] vext01@lemmy.sdf.org 1 point 1 year ago (1 child) Ah, so you're a println! kinda guy? permalink fedilink source parent hideshow 2 child comments replies: [–] unlawfulbooger@lemmy.blahaj.zone 2 points 1 year ago 🦀 🦀🦀🦀🦀🦀🦀🦀 permalink fedilink source parent [–] SqueakyBeaver@lemmy.blahaj.zone 2 points 1 year ago 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) permalink fedilink source parent
[–] unlawfulbooger@lemmy.blahaj.zone 11 points 1 year ago (1 child) Boy am I glad I don’t do C++ anymore. That string handling with the overloaded bitshift operator was wild. permalink fedilink source parent hideshow 2 child comments replies: [–] vext01@lemmy.sdf.org 1 point 1 year ago (1 child) Ah, so you're a println! kinda guy? permalink fedilink source parent hideshow 2 child comments replies: [–] unlawfulbooger@lemmy.blahaj.zone 2 points 1 year ago 🦀 🦀🦀🦀🦀🦀🦀🦀 permalink fedilink source parent
[–] vext01@lemmy.sdf.org 1 point 1 year ago (1 child) Ah, so you're a println! kinda guy? permalink fedilink source parent hideshow 2 child comments replies: [–] unlawfulbooger@lemmy.blahaj.zone 2 points 1 year ago 🦀 🦀🦀🦀🦀🦀🦀🦀 permalink fedilink source parent
[–] SqueakyBeaver@lemmy.blahaj.zone 2 points 1 year ago 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) permalink fedilink source parent
[–] allywilson@lemmy.ml 3 points 1 year ago From memory it's a way to declare a line ending after your string. permalink fedilink source parent