Possible Duplicate:
Why does printf not flush after the call unless a newline is in the format string? (in C)
I've a code like this:
printf("Starting nets allocation...");
while(...)
{
...some operations...
}
puts("DONE");
The code should prints immediately the string "Starting nets allocation..." then, after the loop, should prints "DONE".
Instead, the program performs first the loop and then prints the string "Starting nets allocation...DONE" why it happens? How can I resolve this?