title: Read file line by line using ifstream in C++
body: <p>The contents of file.txt are:</p>
  <pre><code>5 3
  6 4
  7 1
  10 5
  11 6
  12 3
  12 4
  </code></pre>
  <p>Where <code>5 3</code> is a coordinate pair.
  How do I process this data line by line in C++?</p>
  <p>I am able to get the first line, but how do I get the next line of the file?</p>
  <pre><code>ifstream myfile;
  myfile.open (&quot;file.txt&quot;);
  </code></pre>