You're viewing a single thread.
What the heck is endl???
15 0 Replystd::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 preferred39 0 ReplyInstead of this:
cout << "Hello world.\n";
You can do this:
cout << "Hello world." << endl;
10 0 ReplyThe fact that you used the namespace for
cout
but not forendl
inordinately bothers me5 0 Replysomething has replaced your lessthan signs with their HTML counterparts. such a silly thing to do in a code block
1 0 ReplyI think that's client side. Doesn't happen for me.
3 0 Replysame here. AP isn't standardized enough, apparently
1 0 Replynah its a lemmy app on android that didn't get an update in ages. probably just uses a faulty markdown renderer
1 0 Reply
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)
2 0 ReplyBoy am I glad I don’t do C++ anymore. That string handling with the overloaded bitshift operator was wild.
11 0 ReplyAh, so you're a println! kinda guy?
1 0 Reply🦀 🦀🦀🦀🦀🦀🦀🦀
2 0 Reply
From memory it's a way to declare a line ending after your string.
3 0 ReplyGod bless your soul.
2 0 Reply