问题描述
在qsort的macos文档中,我们看到以下声明:
void qsort_b(void *base,size_t nel,size_t width,int (^compar)(const void *,const void *));
插入符号是什么意思?
解决方法
函数声明中的^表示回调是块指针而不是函数指针。
如稍后在手册页中所述:
The heapsort_b(),mergesort_b(),and qsort_b() routines are like the corresponding routines without the _b suffix,expect that the compar
callback is a block pointer instead of a function pointer.