I am in the middle of a college project which kind of looks like a students' database. Each line of the text file follows this "model":
age ; full_name ; avg
I need to read the text file and store everything in a vector of structs and I could do that if the name was only one word.
Well, obviously, age is an int, avg is a double, but what about the full name?
I can't just use file >> full_name;
, with full_name being a string because it would stop reading to it once it gets to a whitespace. The getline()
function would store everything in one place so I am not sure what to do.
Please share your knowlegde with this young mind x)