I am currently looking into sorting a struct array by a particular field within the structs using the qsort function, but I could use a starting point.
Here is my current struct array:
/* database struct */
typedef struct node {
char name[MAX];
char lname[MAX];
char address[MAX];
char number[MAX];
}record_type;
/* global variables */
record_type record[100];
I would like to be able to sort this by the "name" field alphabetically (A-Z). All entries in each char array are lowercase. I'm having a hard time finding info about how to do this online or in a C book that I have. Could anyone point me in the right direction?