I have 2 issues, the first one is, I can't get my lines to match up in the print out of my array. I can only get the first line to match up!
void printStructs(struct student *list, int size){ int j = 0; printf("Last Name, First Name Term ID Course Section\n"); printf("-------------------------------- ---- --------- ------ -------\n"); while(j < size){ printf("%s, %-21s %-5d %-11d %s%d %7s\n", list[j].lastname, list[j].firstname, list[j].term, list[j].id, list[j].subjectname,list[j].catalog, list[j].section); j++; } } This provides me with the output of this!

See how only the first one is lined up properly? How do I get the remaining lines to do this!?
Now my second issue is one I just simply can't see. Notice that extra "Susan" in the second to last line before the last name is displayed? Where is that coming from!? It works for all the other names, what am I not seeing here?
EDIT: The error involving the extra name CAN NOT BE FOUND HERE! just realized it has something to do with my loop initializing the name to that value, will edit further if I can't figure it out, for now ignore!
EDIT2 "Extra String Issue!":
Alright so I have narrowed down where the issue is but not exactly why it happens, I believe it has something to do with delimiters...here is the code
studentsRead = readStudentList(inputf, students, N); printf("%s\n", students[6].lastname); printStructs(students, studentsRead); /*for (j = 1 ; j <= 10-1 ; j++){ for(k = 0 ; k <= 10-2 ; k++){ if(students[k] > students[k+1]){ temp = students[k]; students[k] = students[k+1]; students[k+1] = temp; } } }*/ fclose(inputf); return 0; } int readStudentList(FILE *f, struct student *list, int maxSize){ char buff[65]; int count = 0; while((count < maxSize) && (fgets(buff, sizeof(buff), f) != NULL)){ struct student item; if(parseStudent(&item, buff)){ list[count++] = item; } } return count; } int parseStudent(struct student *person, char *data){ char *ptr; int i = 0; ptr = strtok(data, DELIM); person[i].term = atoi(ptr); ptr = strtok(NULL, DELIM); person[i].id = atoi(ptr); ptr = strtok(NULL, DELIM); strcpy(person[i].lastname, ptr); printf("%s\n", person[i].lastname); ptr = strtok(NULL, DELIM); strcpy(person[i].firstname, ptr); ptr = strtok(NULL, DELIM); strcpy(person[i].subjectname, ptr); ptr = strtok(NULL, DELIM); person[i].catalog = atoi(ptr); ptr = strtok(NULL, DELIM); strcpy(person[i].section, ptr); } Going through this code everything prints normally until that printf after my readStudentList call, which prints out the last name with the first name String stuck in at the end. Although printed in my parse function the last name seems to appear normally? I've been attempting to put print outs all over the place to see where it goes wrong but some of them wont even print anything?
