Weird space

I am working on a way to read from a txt and put the info into a vector but I am getting a weird problem. The txt looks like this:
4
381734 41
837231 380
291048 25
426580 204
4
381734 Ian Malcom
837231 Neil Grant
291048 Shaun Pegg
426580 Ed Frost
but when I take the 4 out there is a blank in userid[0] is there anything I may have forgot? Thanks



string line;
int gett;
ifstream users("mustangusers.txt");
users>>line;
gett=stoi(line);
vector<string> userid;
int x=0;
while(getline(users,line)&&x<=gett){
userid.push_back(line);
x++;
}
You should use condition

while ( getline( users,l ine ) && x < gett ){
Topic archived. No new replies allowed.