Input file reading error
<p>Hi i currently wrote a program but I'm having problems with reading the file. It seems to have read the last line twice, as a result, producing the same results twice.</p>

<p>I had put the getline() function to read the first line, in order to store the string for the variable G.
The rest, I had stored it in a vector of the class object.</p>

<p>basically the file is opened and it performs this loop</p>

<pre><code>file.open("bodies1.txt");
getline(file, G1);
....


while(!file.eof)
{
  file &gt;&gt; body;
  bodies.push_back(body);
}
</code></pre>

<p>this is what the text file look like (this is just a sample. not the actual thing)</p>

<pre><code>0.02932
Sun 32 42 53 2 2
Moon 49 32 4 2 1
Jupiter 32 53 2 3 2
</code></pre>

<p>I really was wondering why it read the last line twice. Any suggestions?</p>
