title: Read string from file in C
body: <p>I have a file with multiple strings, each string on a separate line. All strings are 32 character long (so 33 with the '\n' at the end).</p>
  
  <p>I am trying to read all the strings. For now, I just want to read them and not store them as follows:</p>
  
  <pre><code>char line[32];
  while (!feof(fp)) {
      fgets(line, 32, fp);
  }
  printf("%s", line);
  </code></pre>
  
  <p>This prints out zero. Why isn't it working?</p>
  
  <p>Furthermore, I am trying to store a null terminator at the end of each string read. I changed the <code>line</code> array to length <code>33</code> but how would I make it that if <code>'\n'</code> is found, replace it with <code>\0</code> and store that?</p>