You have ...
after reading in howmany, the '\n' is still in the input stream.Code:inFile >> howmany; // ... inFile.get(ps[count].fullname, strsize);
So the "get" reads an empty record. You need to get rid of the
'\n' from the first input.
Is there a reason you are using "get" in the loop, instead of getline() ?Code:inFile >> howmany; inFile.ignore(1000,'\n'); // add this line




Reply With Quote