Closed GoogleCodeExporter closed 9 years ago
int int_cmp(void* a, void* b) { return (int)a - (int)b; } 是把a和b的地址强转成int型后比较,并非比较a,b实际的值 应该是 int int_cmp(void* a, void* b) { return *(int *)a - *(int *)b; }
Original issue reported on code.google.com by xuerubin...@163.com on 8 Aug 2010 at 4:31
xuerubin...@163.com
谢谢。这个没错:a/b并不是指针,是一个整数,所以不能转�� �成指针再取内容。
Original comment by xianji...@gmail.com on 17 Aug 2010 at 9:28
xianji...@gmail.com
Original issue reported on code.google.com by
xuerubin...@163.com
on 8 Aug 2010 at 4:31