You can enable unit buffering for cout
at the beginning of your program if you really want to:
std::cout << std::unitbuf;
This will flush the buffer after every output operation.
In your situation, I'd consider this a bit of a hack rather than a solution though. There are performance penalties associated with flushing (though they do not matter if you don't print at high frequencies).