I am trying to get a better understanding of what happens to the buffer
when we do not use std::endl
after std::cout
.
Let us consider the following piece of C++ code -
int main(int argc, char** argv) {
std::cout << "Hello World!";
return 0;
}
As per my understanding, std::cout
would add the string Hello World!
to the buffer
. If we do not add std::endl
at the end of the code - std::cout << "Hello World!" << std::endl;
, should we or should we not expect Hello World!
to be printed as output?