[comp.lang.c] qsort parameters

darcy@druid.uucp (D'Arcy J.M. Cain) (05/09/91)

In article <1991May9.042556.5565@csc.canberra.edu.au> Rey Paulo writes:
>and compare.  My problem is that width which is the size of each element in
>the array, varies with each string element.  What value of width should I
>pass to qsort to make it do the job.  My data structure is char *filenames[],
>and I would like qsort to sort the array.

Actually the size of each element is exactly the same throughout the array.
It is the size of a pointer to character and the size of the string has no
bearing on the case.  Use something like:
  qsort(filenames, number_of_filenames, sizeof(filenames[0]), sort_routine);

Hey, here's a switch.  This is a C language specific question, not an OS
related one.  Followups to comp.lang.c.

-- 
D'Arcy J.M. Cain (darcy@druid)     |
D'Arcy Cain Consulting             |   There's no government
Toronto, Ontario, Canada           |   like no government!
+1 416 424 2871                    |