Xref: utzoo comp.unix.questions:31176 comp.lang.c:39155 Newsgroups: comp.unix.questions,comp.lang.c Path: utzoo!utgpu!news-server.csri.toronto.edu!torsqnt!lethe!druid!darcy From: darcy@druid.uucp (D'Arcy J.M. Cain) Subject: Re: qsort parameters Message-ID: <1991May9.142252.16884@druid.uucp> Followup-To: comp.lang.c Organization: D'Arcy Cain Consulting, West Hill, Ontario References: <1991May9.042556.5565@csc.canberra.edu.au> Date: Thu, 9 May 91 14:22:52 GMT 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 |