1.abs :求绝对值
头文件:math.h 或者 stdlib.h
int abs( int n );
The abs function returns the absolute value of its parameter
2.atoi:转化数字字符串为数字
头文件:stdlib.h
int atoi (const char * str);
Convert string to integer
On success, the function returns the converted integral number as an int
value.
3.qsort:实现对任意内容的大小排序
头文件:stdlib.h
void qsort (void* base, size_t num, size_t size, int (*compar)(const void*,const void*));
base为指针起点 Pointer to the first object of the array to be sorted, converted to a void*
num为比较的元素个数 Number of elements in the array pointed to by base.
size是每个元素的大小(常借助sizeof)Size in bytes of each element in the array.
int (*compar)(const void*,const void*) 该函数指针是需要被调用的比较函数(该函数的目的是,为了让base指向的num个元素,可以反复利用该函数比较大小)
最后,英语阅读能力很重要。C被西方人创造完善,多数文献还是英文原著,最有营养!
推荐学习网站cplusplus.com