title: "printf" doesn't print a string immediately
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1716296/why-does-printf-not-flush-after-the-call-unless-a-newline-is-in-the-format-strin">Why does printf not flush after the call unless a newline is in the format string? (in C)</a>  </p>
  </blockquote>
  
  
  
  <p>I've a code like this:</p>
  
  <pre><code>printf("Starting nets allocation...");
  while(...)
  {
      ...some operations...
  }
  puts("DONE");
  </code></pre>
  
  <p>The code should prints immediately the string "Starting nets allocation..." then, after the loop, should prints "DONE".</p>
  
  <p>Instead, the program performs first the loop and then prints the string "Starting nets allocation...DONE"
  why it happens? How can I resolve this?</p>