Quote:Original post by ApochPiQUh, no.
...in C++, it is preferred to use std::cout::endl rather than '\n' or similar escape sequences. endl is more portable and guaranteed to produce the proper sequence. It is also guaranteed to properly flush the output buffer.
First, it's std::endl, as endl is a manipulator and a member of the std namespace, not a member of some class or namespace "cout" (cout is also an object).
Second, endl is not "preferred" to \n. Its meaning is equivalent to inserting a newline and then flushing the stream, and it should only be used when both actions are desired. You can insert newlines when that's all you want, or you can flush the stream if that's all you want (insert std::flush).
Happy hacking.