If I have a structure with two different datatypes as fields of the structure, ie:
Now I have an array of these items and I want to sort them using qsort first by value, then by name. (ie, if there are two elements that have the same value, I would then sort those two elements by their name)Code:typedef struct { int value; char *name; } item;
How would I approach this using qsort? Thanks.