And yes, this thing is the devil and should not be used. I'm sad so much books and courses about C++ use this thing as a "new line" character, it is not. It happens to print one before flushing.
std::cin and std::cout will synchronize themselves, you don't need to flush by hand, you just makes your program slower that it should be, and this tend to make me angry ;-)
Indeed. +1 for using \n instead of std::eol.
Indeed! (You probably mean
std::endl
;-))And yes, this thing is the devil and should not be used. I'm sad so much books and courses about C++ use this thing as a "new line" character, it is not. It happens to print one before flushing.
std::cin and std::cout will synchronize themselves, you don't need to flush by hand, you just makes your program slower that it should be, and this tend to make me angry ;-)
Oh yeah, I meant
std::endl
... haha I have read too much about LF and CRLF eol's these daysRemark, I wouldn't be a bad thing to have a global called "eol" or "lf" in std that doesn't flush the output. :-)
But it's really a shame that they called this thing "endl"...