I don\'t know if it\'s related to flush in ostream. Since, endl is end with flush right? I don\'t know what is flush and how it works.
I have a function that will pr
Flushing makes sure all output written to the stream so far is shown on the console.
You can do std::cout << std::flush
or std::cout.flush()
after each output operation to make sure the output is shown on the console immediately.
Right now it's just writing everything to the stream and only flushing the stream after the loop.