S
subramanian100in
In the ISO document
www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
in the detail of the qsort library function in 7.20.5.2, the
description says that, the contents of the array are sorted into
ascending order.
MY QUESTION:
Does it mean to include descending order also ?
If not, suppose we write the comparison function in such a way that it
returns less than, equal to, or greater than zero if the first
argument is greater than, equal to, or less than the second argument,
we should be able to use the qsort to sort the array elements into
descending order.
Am I correct or wrong ? Kindly explain.
www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf
in the detail of the qsort library function in 7.20.5.2, the
description says that, the contents of the array are sorted into
ascending order.
MY QUESTION:
Does it mean to include descending order also ?
If not, suppose we write the comparison function in such a way that it
returns less than, equal to, or greater than zero if the first
argument is greater than, equal to, or less than the second argument,
we should be able to use the qsort to sort the array elements into
descending order.
Am I correct or wrong ? Kindly explain.