title: unable to write into file
body: <p>This is code to write contents in file.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  #include&lt;string.h&gt;
  void main()
  {
     FILE *fp;
     char ch(90);
     fp = fopen("books.txt","w");
     if(fp == NULL)
     {
          puts("Cannot open file");
     }
     printf("Enter lines of text:");
     while(strlen(gets(ch)) &gt; 0)
     {
         fputs(ch, fp);
     }
     fclose(fp);
  }
  </code></pre>
  
  <p>I'm getting 4 errors. These are: </p>
  
  <blockquote>
    <ol>
    <li>Cannot convert <code>int</code> to <code>char *</code> in function <code>main()</code>.</li>
    <li>Type mismatch in parameter <code>__s</code> in call to <code>gets(char *)</code> in     function <code>main()</code>.</li>
    <li>Cannot convert <code>int</code> to <code>const char *</code> in function <code>main()</code>.</li>
    <li>Type mismatch in parameter <code>__s</code> in call to <code>fputs(const char *,FILE *)</code> in function <code>main()</code>.</li>
    </ol>
  </blockquote>