But it's also incorrect; qsort, at *call* time, will call your comparison function as an int (*foo)(const void *, const void *) and it invokes undefined behavior to call any other kind of function that way. (It will work on machines which use the same representation for all pointers to functions, but this is sloppy.) -s