- 论坛徽章:
- 0
|
本帖最后由 0xC1988 于 2012-04-17 18:04 编辑
陈良乔 发表于 2012-04-17 17:34
我想请教一下,在什么时候,什么情况下会出现问题?
The qsort() function sorts an array with nmemb elements
of size size. The base argument points to the start of
the array.
The contents of the array are sorted in ascending order
according to a comparison function pointed to by compar,
which is called with two arguments that point to the
objects being compared.
The comparison function must return an integer less
than, equal to, or greater than zero if the first argu?
ment is considered to be respectively less than, equal
to, or greater than the second. If two members compare
as equal, their order in the sorted array is undefined.
你的代码,a>b return 0,a=b return 1,a<b return 1,我还是想问,你代码验证过吗? |
|