Yes, they are different.
"\n" is just a string of length 1 that is appended to stdout.
std::endl, instead, is an object that will add a newline character ( "\n") AND to flush the stdout buffer. For this reason, more processing is required.
peoro source
share