title: Printf function in C not printing until while loop finished
body: <p>I want to test if different loops are active, so I have a print statement that repeats every 500ms in each loop, however the print statement does not print every 500ms, it waits until the loop is finished and then prints everything at once instead of periodically.</p>
  
  <p>How do I get my program to print to the terminal periodically?</p>
  
  <p>I'm a student so my knowledge of SDL is pretty limited so thorough explanation would be appreciated. </p>
  
  <pre><code>int main(void)
  {
      int i = 0;
      while(i&lt;10)
          {
              printf("While loop active.\t"); i++;
              SDL_Delay(500);
          }
      return 0;
  }
  </code></pre>
  
  <p>P.S. I saw that duplicate question but I disagree as his question suggests an issue with 'signal handling' which I know nothing about so when asking this question, I didn't think his question would have the same answer as mine. I accept the answers given are the same though.</p>