IN C LANGUAGE: I've been trying to finish this program for the last few days, and I'm stuck on one part of it, and I can't figure out what to do. The goal is to read in a file (separated by commas), put the information into a linked list, and then sort that linked list by either first or last name using function pointers. Everything I have so far works, aside from the fact that my output is never sorted. I'm doing something wrong with the listSort function, and I don't know what it is. Can anyone please just take a look at what I have and offer a suggestion or solution? It might not even be an issue with the function itself, but something somewhere else. I would greatly appreciate it. Please do not make any changes to the variables in the structs. Month has to be a string, it cannot be an integer. driver.c: #include "functions.h" #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <string.h> int main(int argc, char* argv[]) { //creating input and output files FILE* in = NULL; FILE* out = NULL; node_t* head = NULL; node_t* temp = NULL; //checking for 4 command line arguments assert(argc == 4); //opening input file in = fopen(argv[1], "r"); assert(in != NULL); //opening output file out = fopen(argv[2], "w"); assert(out != NULL); int sortBy = atoi(argv[4]); temp = createList(in, &head); if(sortBy == 1) { sortList(&head, compare_by_firstname); } else if(sortBy == 2) { sortList(&head, compare_by_lastname); } printList(out, temp); deleteList(&head); //closing files fclose(in); fclose(out); return 0; } functions.c: #include "functions.h" #include <stdio.h> #include <stdlib.h> #include <assert.h> #include <string.h> #include <stdbool.h> bool isLeapYear(int year) { if(year % 4 != 0) { return false; } else if(year % 100 != 0) { return true; } else if(year % 400 != 0) { return false; } else { return true; } } void printBorder(FILE* out) { int i = 0; for(i = 0; i < 80; i++) fprintf(out,"*"); fprintf(out, "\n"); } bool checkInvalidDate(node_t *node) { int year = (int)node->birthday.year; if(node->birthday.day < 1 || node->birthday.year < 1) { return true; } if(strcmp(node->birthday.month, "February") == 0) { if(isLeapYear(year)) { if(node->birthday.day > 29) { return true; } } else if(node->birthday.day > 28) { return true; } } else if((strcmp(node->birthday.month, "April") == 0) || (strcmp(node->birthday.month, "June") == 0) || (strcmp(node->birthday.month, "September") == 0) || (strcmp(node->birthday.month, "November") == 0)) { if(node->birthday.day > 30) { return true; } } else { if(node->birthday.day > 31) { return true; } } return false; } void add(node_t **node, node_t **head) { node_t* current = *head; while(current != NULL) { //comparing first and last names to check for duplicates; if duplicate the info isn't added to the list if((strcmp(current->firstName, (*node)->firstName) == 0) && (strcmp(current->lastName, (*node)->lastName) == 0)) { return; } current = current->next; } //adding information as a node to the list (*node.