flush() makes sure the file stream is updated with the data. endl() puts a newline and then uses flush().
It's not bad to use a lot of either, just unnecessary.
For instance, on Haiku (which is another operating system) you are expected to flush std::cout or the text won't display.
On Windows, in my experience, that's not needed.