I have a text file that looks like this:
1;Einstein;Albert;3914-1948-4
2;Newton;Isaac;1941-5525-2
...
and a struct like this
typedef struct {
int Nr;
char FName[30];
char LName[30];
char ID[12];
} student;
I have a function that takes a string structured like one line from the file above and a struct and saves the data from the line in the struct.
Now I have to read one line from the file, process it with my function and go to the next line.
I would do it in a loop that would jump from line to line and create a new variable type student for each line.
But I have no idea how to do that. fgets only lets you read in one line and I don't see a way to jump to the next line.
Is there a way to do this that is not too complicated?