need help with vector out of range error
<p>guys, I'm reading from a file and input into a vector, but I keep getting a pop up box with: "vector employees out of range!" error. It is like if I'm trying to access pass the last index in the vector, but if that's the case I don't see... any help appreciated
text file:</p>

<pre><code>123 vazquez 60000
222 james 100000
333 jons 50000
444 page 40000
555 plant 40000
</code></pre>

<p>code:</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;fstream&gt;
#include &lt;vector&gt;
using namespace std;

struct employees { int id; string lname; double salary; };
void getData(vector&lt;employees&gt;&amp; list, ifstream&amp; inf);
int i = 0;
int main()
{
    string filename("file2.txt");
    vector&lt;employees&gt; list;
    ifstream inf;
    inf.open(filename);

    getData(list, inf);
    inf.close();

    for(unsigned int j = 0; j &lt; list.size(); j++)
    {
        cout &lt;&lt; list[j].id &lt;&lt; " " &lt;&lt; list[i].lname &lt;&lt; endl;
    }

    system("pause");
    return 0;
}

void getData(vector&lt;employees&gt;&amp; list, ifstream&amp; inf)
{
    int i = 0;
    while(inf)
    {
        inf &gt;&gt; list[i].id &gt;&gt; list[i].lname &gt;&gt; list[i].salary;
        i++;
    }
}
</code></pre>
