--- In [email protected], "John Matthews" <[EMAIL PROTECTED]> wrote:
>
> --- In [email protected], "Rick Bowers" <Mowgli53@> wrote:
> >
> > I am trying to sort an array of pointers to a structure.
> 
> Hi Rick- below is an example program

Sorry, minor correction:

> static int compareEntryPtr(const void *a, const void *b)
> {
>     ENTRY *const *pE1 = a;
>     ENTRY *const *pE2 = b;
> 
>     return compareEntry(*pE1, *pE2);

Last line should be:

    return cmpEntries(*pE1, *pE2);

Also, note that 'real' code should check that malloc() doesn't return
NULL, and in general you should free any malloc()ed memory.

Reply via email to