On Thu, 12 Nov 1998, Ryan Allen wrote:

>Hi,

Hi. I can't say for sure whats wrong but there's something you could
check...

First, compile with -Wall (I assume you use GCC).

>typedef struct uu_rec
>{
>        char            username[50];
>        int             bytesSent;
>        int             bytesRecieved;
>        char            trans_date[30];
>} UU_Record; 
>UU_Record       data_list[15000]; 

>int my_strcmp(const void *a, const void *b)
>{    return strcmp( ((UU_Record *)a)->username,((UU_Record*)b)->username); 
>}

Could this be

return strcmp(&(((UU_Record*)a)->username),&(((UU_Record*)b)->username)); 

Because username is an array of characters but strcmp wants pointer to
char?

>qsort(data_list, 15000, sizeof(UU_Record), my_strcmp);

Maybe this would need to be 

qsort(&data_list, 15000, sizeof(UU_Record), my_strcmp);

or even

qsort(&data_list, 15000, sizeof(UU_Record), &my_strcmp);

Since qsort wants pointers as well.

If this doesn't help I'm sure somebody who knows more than me (esp. Glynn :)
answers soon with right solutions.

--
| Tuukka Toivonen <[EMAIL PROTECTED]>       [PGP public key
| Homepage: http://www.ee.oulu.fi/~tuukkat/       available]
| Try also finger -l [EMAIL PROTECTED]
| Studying information engineering at the University of Oulu
+-----------------------------------------------------------

Reply via email to