title: How does getline() work?
body: <p>I have this piece of code that I use to load a linked list from a binary or a text file .. It works fine for text files but it always loads an extra line in the binary case , So I need to know how getline works:</p>
  
  <pre><code>while(1)
  {
       if(!file.good())
            break;
  
       getline(file,line);
       student.name=line;
  
       getline(file,line);
       student.phone=line;
  
       current-&gt;insert(student);
  }
  </code></pre>