de********@yahoo.com (Debashish Chakravarty) writes:
Would it have been a good idea if the comparison function in quicksort
You mean qsort().
took three const void * parameters in, the third one for extra
information that might be required to compare the two objects, I think
the only way one can pass the information is by using global or static
variables.
Yes, it would be a good idea. It is too bad that it doesn't. It
is sometimes difficult to effectively use qsort() and bsearch()
for this very reason. Most well-designed C abstract data type
extension libraries have such a mechanism for this very reason.
--
Peter Seebach on C99:
"[F]or the most part, features were added, not removed. This sounds
great until you try to carry a full-sized printout of the standard
around for a day."