According to Sven Hilscher:
program Sort_Test; [...] procedure qsort(var base; numelem, size : Integer; cmp: FuncType); C;
Better say `cmp: Pointer' here because you don't really know the type of the function `cmp' is pointing to. Otherwise you get a warning: incompatible type for argument 4 of `Qsort'.
qsort(tb, 5, Sizeof(tb[1]), @CompString);
The resulting error ("too few arguments") is fixed now. Thanks.
A new GPC beta - probably the last one before we can release gpc-2.1 - will be uploaded to Agnes as soon as possible (whatever that means;-).
Greetings,
Peter
Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201] maintainer GNU Pascal [970714] - http://home.pages.de/~gnu-pascal/ [970125]
Hello Peter,
you said:
program Sort_Test; [...] procedure qsort(var base; numelem, size : Integer; cmp: FuncType); C;
Better say `cmp: Pointer' here because you don't really know the type of the function `cmp' is pointing to.
No - IMHO qsort need always a function (cmp) that return an Integer, but the parameters/arguments of this function are pointers on different types.
qsort(tb, 5, Sizeof(tb[1]), @CompString);
The resulting error ("too few arguments") is fixed now. Thanks.
You found also the reason for the crash on sorting a "array of Byte"? Look at my sample!
___, ((__ o ,____)) V E N I