Re: [algogeeks] qsort

2010-12-08 Thread fenghuang
you mean the function qsort() in crt? here is a sample struct foostruct{ int key; int value1; int value2; }; int compare(const void* a1, const void* a2){ return ((foostruct*)a1)->key - ((const foostruct*)a2)->key; } void bar(){ foostruct s[] ={ {3, 2, 3}, {5, 2, 1}, {2, 6, 5} }; qsort(s, sizeof

[algogeeks] qsort

2010-12-08 Thread ANUJ KUMAR
how can i use qsort a structure. please give me the code if possibe -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algoge...@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsu