Okay. I have a file called "Graduates.txt" in my home directory.
I have a portable program to find the home directory, and I opened the file for reading.
Data in the file looks something like this:
year,firstName,lastName
I need to get this data from this file, and separate it into my struct:
typedef struct alumnus {
int yearGraduated;
char firstName[30];
char lastName[30];
} Alumns;
I have a thought that may or may not work:
A while loop reads through the file, using fgets() to get the data. It then copies it to the struct... but I don't know how to implement any of this.
Sorry if this sounds like dumb question, it most likely is.