Function-types: compatability, and typedefs
Richard O'Keefe
ok at cs.mu.oz.au
Sun Sep 3 16:21:33 AEST 1989
In article <1989Sep1.113440.28300 at jarvis.csri.toronto.edu>, flaps at dgp.toronto.edu (Alan J Rosenthal) writes:
> ok at cs.mu.oz.au (Richard O'Keefe) writes:
> >What you need is
> > int strptrcmp(char **s1, char **s2)
> > { return strcmp(*s1, *s2); }
> Actually, you should write
> int strptrcmp(void *s1, void *s2)
> { return(strcmp(*(char **)s1, *(char **)s2)); }
Sorry; I was working from an old manual with char *base and so on.
I haven't got a current AN$I C draft: too co$tly.
If you're sorting an array of numbers, a half-way decent radix sort will
GROSSLY outperform qsort(), and if you're sorting anything else qsort()
is too inefficient anyway.
More information about the Comp.lang.c
mailing list