I am new to programming in C++ and am trying to do a practice problem, but I don't really understand what it is trying to get me to do since a vector can only hold one data type (unless it can hold more):
Read in a .csv file where each line is structured as such: "username,gpa,age". Store these values into a struct with username, gpa, and age (string,float,int) and create a list as a vector. As you read in each line, insert into the vector list sorted by username. Then loop through and print out the list formatted as : "username [gpa] age:#" e.g., "mark [3.9] age:19" and also write the output to a file (using C++, not Unix).
Am I supposed to put all of those values into the same vector as separate data types or keep them all together in a string and then insert them? How do I store these values into a struct? If someone can tell me how they would solve the question and give me some sample code that'd be great, thank you.