I've been working on a program to collect data from a txt file into an array of structs. I think that I can figure out how to fill the array of structs however, I'm having trouble capturing the appropriate information into each member.
My function is not pulling all of the appropriate data. the number initial int is only reading the 3 not the proceeding 2 0s, the first string is ok, the 2nd string was ok until I messed with the ignore(); the third string only captures seed and not pokemon. The next two doubles capture 0 instead of what is in the txt file. and the ablities are not captured.
Since getline(...) shouldn't read the new line of the previous line (>> doesn't remove the new line) you want to ignore the new line character not space.
change
inputFile.ignore(256,' ');
to
1 2
inputFile.ignore(256,'\n');
// Even better: std::numeric_limits<std::streamsize>::max() instead of 256
This applies to all transitions from >> to getline(...).