function

HI ,
Can some one explain me what this function do . i am not able to understand what exactly the function do and how
1
2
3
4
5
6
7
int function( const void* x , const void* y)
{
   char* c1 = (char*) x; 
   char* y1 = (char*) y;
return *c1 - *y1;

}



Thanks in advance
blue.

Last edited on
It returns the difference of the two bytes stored at those addresses.
Did you find this with an example of using qsort() somewhere?
You can read more about it here, plus a number of examples:
http://www.cplusplus.com/faq/sequences/sequencing/sort-stuff/#c
Topic archived. No new replies allowed.