title: When fputs is used directly for writing character array in a file, a different format of text is stored
body: <p>When I used <code>fputs()</code> to directly store a character array in a file, it stored this in the file:</p>
  
  <pre><code>ÈLwìþ( 
  </code></pre>
  
  <p>Why was that?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      FILE *p;
      p=fopen("pa.txt","w+");
      char name[100];
      printf("Enter a string :");
      fputs(name,p);
      fclose(p);
      getchar();
      return 0;
  }
  </code></pre>
  
  <p>When I take input in name using <code>scanf()</code> or <code>gets()</code>, the correct text is stored but when directly use <code>fputs()</code> is used it stored in an unusual format.
  Why does this happen?</p>