Not understanding why text file contents are not being stored in individual elements of vector
<pre><code>#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;
#include &lt;vector&gt;
using namespace std;

int main()
{
    ifstream inFile("test.txt");
    string line;

    while(getline(inFile, line))
    {
        istringstream meh(line);
        int n;
        vector&lt;int&gt; v;

        while(meh &gt;&gt; n)
            v.push_back(n);
    }
}
</code></pre>

<p>My test.txt file looks like:</p>

<pre><code>429384
392041
230138
099938
243324
</code></pre>

<p>If I try to print v[0] I get the entire sequence of numbers back (42938...3324) instead of just the first number 4.  Can anyone explain why this is happening?</p>
