> while(!feof(inFile)){
This has to be one of the most common mistakes
feof() does not become true UNTIL a read function (like fscanf) has failed to read something.
This means that the last fscanf in your loop really did not read any data, and just returned EOF (which I guess you didn't test either).
Try this
Code:
struct student *ReadData(FILE* inFile)
{
struct student *head = NULL; // the list
struct student *ptr1; // the next node
struct student temp; // file data
while ( fscanf(inFile,"%d\n%s\n%d",
&temp.studentID, temp.studentname, &temp.credit ) != EOF ) {
// new node
ptr1 = malloc( sizeof( struct student ) );
ptr1->studentID = temp.studentID;
// etc
// now link ptr1 into the list starting at head
}