title: Comparing strings in C
body: <p>I have a program that reads student names and grades line by line from a .txt file using fgets and a buffer declared as:</p>
  
  <pre><code>char buffer[1024];
  </code></pre>
  
  <p>Now the file should end with the string "end" on a line all by itself.</p>
  
  <p>How do I tell a while loop to terminate when <code>buffer == "end"</code>?</p>
  
  <p>I tried using <code>strcmp</code> but it segfaults for some reason.</p>