Hello all,
Suppose we have the following struct :
struct foo {
int a;
int b;
char *c;
}
And :
struct foo bar[100]
And we want to sort bar in relation to a mode, for example if mode == 1 then
sort bar by comparing a member, if mode == 2 then sort bar by comparing b
members and so on. The mode variable cannot be used as extern and qsort()
prototype needs a function compar() which takes two void * arguments. Is
there any way to pass the mode variable to compar() or I have to write my
own qsort() ?
D.
--
PGP key 39A40276 at wwwkeys.eu.pgp.net
key fingeprint: 9A0B 61C6 B826 4B73 69BB 972B C5E7 A153 39A4 0276