I was wondering if you can use the qsort function with an array of data structures in c?
I have the following code -
int compare( const void *arg1, const void *arg2 )
int strcomp = strcmp(arg1, arg2);
if (strcomp < 0)
if (strcomp == 0)
I am trying to sort by a specific field in the structure (ie arrayname.firstname)