My program works perfectly (WOOHOO!!!!)
Just one little warning I'm getting:
Code:
countWords.c:57: warning: passing argument 4 of ‘qsort’ from incompatible pointer type
Line 57:
Code:
qsort( hte_array, HT_getNrOfElements(), sizeof(HT_Element), compar_HTelements);
And my function:
Code:
int compar_HTelements(HT_Element *pa, HT_Element *pb)
{
if ( (*pb).count != (*pa).count )
return (*pb).count - (*pa).count;
else
return strcmp( (*pa).word, (*pb).word );
}
Why is the compiler giving a warning here? Why is it not valid?
Thanks!
=D