I am trying to use qsort on an array of structs but I get this error: expected primary-expression before '*' token
struct muchie {
int x,y,c;
} a[100];
int cmp(const void* p, const void* q)
{
muchie vp,vq;
vp=*(muchie* p);
vq=*(muchie* q);
return vp.c-vq.c;
}
// ....
qsort(a,m,sizeof(muchie),cmp);
(muchie*)std::sort, that's what it's for.