摘要:
Andy's First DictionaryAndy, 8, has a dream - he wants to produce his very own dictionary. This is not an easy task for him, as the number of words that he knows is, well, not quite enough. Instead of thinking up all the words himself, he has a briliant idea. From his bookshelf he would pick one 阅读全文
摘要:
做题时自己也不是很清楚,转来别人的学习一下。一、对int类型数组排序 int num[100]; int cmp ( const void *a , const void *b ) { return *(int *)a - *(int *)b; } 可见:参数列表是两个空指针,现在他要去指向你的数组元素。所以转型为你当前的类型,然后取值。升序排列。 因为是按照acsll码的值进行的,所以在前面的字符的值一定小于后面的字符。 那么,对于a b,如果a的值>b的值,就说明在字母表中a在b的后面,返回值为1表示ture,执行交换。 qsort(num,100,sizeof(nu... 阅读全文