INFO: qsort() Can Sort Data Structures Based on Multiple FieldsLast reviewed: August 26, 1997Article ID: Q28244 |
The information to this article applies to:
SUMMARYThe qsort() function in the Microsoft C run-time library does not restrict the methods an application can use to compare items. When qsort() compares two data elements, it calls an application-supplied comparison routine. To sort an array of structures using more than one field as a key, create a comparison function that relates the appropriate fields in each structure and returns a comparison value to indicate the result. Keywords : CRTIss kbfasttip Version : MS-DOS:5.1,6.0,6.00a,6.00ax,7.0; OS/2:5.1,6.0,6.00a; WINDOWS:1.0,1.5; WINDOWS NT:1.0,2.0,4.0,5.0 Platform : MS-DOS NT OS/2 WINDOWS Issue type : kbinfo |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |