--- In [email protected], "Indika Bandara" <[EMAIL PROTECTED]>
wrote:
>
> man qsort
> ==================================================
>  
>        void qsort(void *base, size_t nmemb, size_t size,
>                   int(*compar)(const void *, const void *));
>  
> DESCRIPTION
> The qsort() function sorts an array with nmemb elements of size
> size.  The base argument points to the start of the array.
>  
> The  contents of the array are sorted in ascending order
> according to a comparison function pointed to by compar, which is
> called with two arguments
> that point to the objects being compared.
> ==================================================
> 
> as man says, "sorts an array with nmemb elements of size size."
> my array contains MAX_NUM of (P*) 
> > >         P** p = new P*[MAX_NUM];
> 
> but if it were 
> int *i = new int[MAX_NUM]
> and 
> qsort(i, MAX_NUM, sizeof(i), CompInt);
> works
> 
> am i doing something silly? can u pls try urself?
<snip>

I won't; I don't have the time. But even if I did have the time:
frankly I don't understand C++ well enough to even judge whether
qsort() can be used with objects this way. I have to leave the
response to this question to other people like Victor, Paul, and many
other ones. Sorry. I'm out of the game here.

Regards,
Nico

Reply via email to