title: How to read in only the first line of a text file?
body: <p>The name of the text file that I want to open is "map.txt". I ONLY want to read in the first line of the file to the console. The first line of the text file is: </p>
  
  <blockquote>
    <p>E1    346    473   1085   3725   30   30</p>
  </blockquote>
  
  <p>Here is the code I have so far.</p>
  
  <pre><code>ifstream file;
  
  file.open("map.txt");
  
  if (!file) //checks to see if file opens properly
  {
      cerr &lt;&lt; "Error: Could not find the requested file.";
  }
      /******* loop or statement needed to read only first line here?**********/
  </code></pre>