0

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;
}
2
Contributors
2
Replies
3
Views
11 Years
Discussion Span
Last Post by rowly
0

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.

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.