i read in some book this "Note that \n is not quite the same as endl. endl will output a newline and flush the stream, while
\n will output the newline without flushing the stream."
It means forcing the contents of the output stream to the default output medium the OS uses (the console on Windows and the terminal on *nix). A stream is a buffer used to store I/O data. For instance, "std::cin" has a buffer to store input data whereas "std::cout's" buffer is used to store data that's going to be sent to screen.
In certain points in a program, the output stream is automatically flushed; flushing is not always necessary.