I have two structs one which holds car information. The function I am writing requires to sort the list by an entered key. The list struct holds the function ptr to use. Can I use this pointer in qsort? I have tried
qsort(pcl->list,pcl->size,sizeof(pcl->list[i]),pcl->CompareFPtr);
but it gives the warning: parsing of arg 4 'qsort' from incompatible pointer type.
any ideas??
typedef struct
{
char *dynamicMake;
char *dynamicModel;
int year;
char rego[7];
} Car;
typedef struct List
{
Car list[LISTSIZE];
unsigned size;
int(*CompareFPtr)(Car*,Car*);
} List;
Any light shed appreciated.