title: How to use fgets if you don't know the number of characters to be read?
body: <p>I need to read a file and send the text from it to a string so I can parse it. However, the program won't know exactly how long the file is, so what would I do if I wanted to use <code>fgets()</code>, or is there a better alternative?</p>
  
  <p>Note:</p>
  
  <pre><code>char *fgets(char *str, size_t num, FILE *stream);
  </code></pre>