1 min to read
C Tips
sort in C
header: stdlib.h
prototype: void qsort(void *base,int nelem,int width,int (*fcmp)(const void *,const void *));
参数:
- 待排序数组首地址
- 数组中待排序元素数量
- 各元素的占用空间大小
- 指向函数的指针,用于确定排序的顺序
array copy in C
header: string.h
prototype: void *memcpy(void*dest, const void *src, size_t n);
近期评论