C函数声明中的脱字号(^)是什么意思?

时间:2020-10-01 11:07:10

标签: c objective-c-blocks cextension

在qsort的macos文档中,我们看到以下声明:

void qsort_b(void *base, size_t nel, size_t width, int (^compar)(const void *, const void *));

插入符号是什么意思?

1 个答案:

答案 0 :(得分:1)

函数声明中的^表示回调是块指针而不是函数指针。

如稍后在手册页中所述:

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.