Hello everyone. The problem I am having is that I am reading from a predefined text file with this type of stucture:
What I am trying to do is to read all of the names into one array and all of the ids into another.
I need to use the method fgets(). I can successfully read the file, but am not sure of the correct way of putting them into the array. I was trying something like this, but to no avail:
From my results, it outputs everything perfectly to the console, but I can't figure out a way to put the data in arrays. Right here, I am just attempting to put the whole line into an array. If you can put me on the right track, I can split the data up later on my own. I just need help on the right way to write to arrays.
i = 0;
while (fgets(line, 2048, pfile) != NULL)