can I make c++ print output "online"

Hi guys.

I have noticed that when I print a message to screen, the message is usually displayed a little bit after the current loop is running. Usually this is not an issue but when I start the program there is a chance for it to go into an infinite loop (depends on the chosen random number) and I need to know that.

Is there a way to force the output to occur "online"

thanks.

Yotam
how do you print? usually flush is the way to go
I'm using printf.

How can I combine that with flush?
fflush(stdout);
Topic archived. No new replies allowed.