title: fprintf not working
body: <p>I'm testing the usage of <code>fprintf()</code> and it is not working. When I first wrote the code I forgot to add <code>\n</code> inside <code>fprintf()</code> and it worked. However, when I added <code>\n</code> at the start of "test 1 2" it stopped working.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main ()
  {
      FILE* f = fopen("test.txt", "r+");
      if( f == NULL) return 0;
  
      char str[4][10];
  
      for(int a = 0; a &lt;= 3; ++a)
      {
          fscanf(f, " %[^\t\n]s", str[a]);
          printf("%s\n", str[a]);
      }
  
      fprintf(f, "\ntest 1 2\n");
  
      fclose(f);
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>and my test.txt contains ( instead of <code>\t</code> and <code>\n</code> I pressed tab and enter in the file but I couldn't manage it here)</p>
  
  <blockquote>
    <p>a b\t  c d\t   e\n
    f g</p>
  </blockquote>