title: How to check for '\n' character using getline() for c-strings
body: <p>I am trying to increment the variable int lines everytime getline encounters a '\n' character in an input file.  However, my variable isn't being incremented after a new line and I'm assuming maybe I'm not checking the buffer correctly that I'm loading the characters of the line into. Here is my code with much of it simplified:</p>
  
  <pre><code>int lines = 0;
  while(input.getline(buffer, 100))
  {
  
  if(buffer[0] == '\n')
     lines++;
  }
  </code></pre>
  
  <p>File format(I want it to increment once it encounters the '\n' between the two lines of data):</p>
  
  <pre><code>20012 CSCI 109 04 90 1 25
  
  -- ID days_constraint start_contraint 
  </code></pre>
  
  <p>Thanks guys.</p>