Can someone explain the difference between:
std::cout << "stuff\n";
...and...:
std::cout << "stuff" << std::endl;
Can someone explain the difference between:
std::cout << "stuff\n";
...and...:
std::cout << "stuff" << std::endl;
They will generate the same characters (i.e. a carriage return), however std::endl
will also flush the stream, which could have an impact on performance if over-used when generating large amounts of output.