Ok, so here's the deal. This is a project for school, and we can't use #include < string >. Basically, for any strings we'll be dealing with, we have to use cstrings, or char arrays that end with a null terminator. Basically the same thing right? Well I'm having a little bit of trouble. I have to read in a first name, last name, a student id, and a minimum of 5 grades but a maximum of 6 grades from an input file. To see what that looks like is below, but there is a catch. There can be an arbitrary amount of spaces in between each of those details, with the maximum length of the line being 250. So an example of the input is below.
Adam Zeller 452231 78 86 91 64 90 76
Barbara Young 274253 88 77 91 66 82
Carl Wilson 112231 87 77 76 78 77 82
Notice, how there are random amounts of spaces in between the details. Basically, I need to get the names (both first name and last name can vary in length), read the student id into an int, and then read all the rest of their grades (preferably into an int array). Also, they can have either 5 or 6 grades,the program should be able to handle either. How in the world do I go about sorting this data? I thought maybe I could getline() into a cstring char array of the whole line, and then seperate each bit accordingly into each array, but I just don't know how to go about this. Indefinitely, I don't want anyone to give me any code, but maybe point me in the right direction of how I could go about this. Sorting a line of data into different variables, while also accounting for either 5 or 6 grades without effecting the data, and also the list could be up to 60 lines long (meaning have up to 60 students on it but no more than that). This is only a portion of the project, but seems to be the one part I can't get past. Again, I don't want any code or direct answers, maybe just point me in the right direction of a way I could go about this. Thanks so much!