title: c++ getline reads entire file
body: <p>I'm using std::getline() to read from a text file, line by line. However, the first call to getline is reading in the entire file! I've also tried specifying the delimeter as '\n' explicitly. Any ideas why this might be happening?</p>
  
  <p>My code:</p>
  
  <pre><code>std::ifstream serialIn;
  ...
  serialIn.open(argv[3]);
  ...
  std::string tmpStr;
  std::getline(serialIn, tmpStr, '\n');
  // All 570 lines in the file is in tmpStr!
  ...
  std::string serialLine;
  std::getline(serialIn, serialLine);
  // serialLine == "" here
  </code></pre>
  
  <p>I am using Visual Studio 2008. The text file has 570 lines (I'm viewing it in Notepad++ fwiw).</p>
  
  <p><strong>Edit:</strong> I worked around this problem by using Notepad++ to convert the line endings in my input text file to "Windows" line endings. The file was written with '\n' at the end of each line, using c++ code. Why would getline() require the Windows line endings (\r\n)?? Does this have to do with character width, or Microsoft implementation?</p>