can any one help with this function how it works !
thanks u

int compare(const void *a,const void *b)
{
data i= *(data *)a;
data j= *(data *)b;

if (i.Mark==j.Mark) return 0; 
if (i.Mark<j.Mark) return -1; 
if (i.Mark>j.Mark) return +1;
}

Recommended Answers

All 2 Replies

What part U dont understand? The void pointer? Well void pointer can be used if you are not shore which type will be passed to func compare.
BTW const void must be separated.

What part U dont understand? The void pointer? Well void pointer can be used if you are not shore which type will be passed to func compare.
BTW const void must be separated.

oups 1 mistake :p
aw ok hehe thats seems easy now :)
anyways found that useful void pointers as well thx alote andor

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.