I have a structure array that is created in a function locally, in order to copy to it the contents of a linked list so that they can be sorted and then printed. How do I implement qsort in this case? Code: /* Initialize record structure for each soldier */ struct record { long int aa; char firstname[20]; char lastname[30]; struct ...
Hi, trying to use qsort to sort an array of 1 million structs! This is my struct: struct cp_container { unsigned int keys; unsigned int cypher; }; this is my array: struct cp_container a1[1000000]; The call to the qsort function: qsort (a1, count, sizeof(struct cp_container), comp_hex); This is the qsort function: int comp_hex(struct cp_container *c1, struct cp_container *c2) { int returnval; ...