排序函数中比较函数cmp的理解
摘要:
无论是使用 sort() 或者 qsort(), 都会使用到自己定义比较函数,习惯上定义为 cmp如:int cmp(const void *x, const void *y) { return *(int*)x - *(int*)y;}我一直也是这样用,直到去年寒假给学弟们讲课的时... 阅读全文
posted @ 2014-04-05 15:37 Stomach_ache 阅读(356) 评论(0) 推荐(0)