Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: Typedef 函数指针?
你能帮我理解这个typedef的含义以及如何使用它吗?
typedef void (*__handler)(int)
没有“typedef”,我知道剩下的是一个函数指针。谢谢你。
这定义了函数指针的类型名称。使用它,__handler现在是指向接受int并返回的函数的指针的类型别名void。
__handler
int
void
void myFunction(int) { // ... } int main(int argc, char **argv) { __handler functionPtr = &myFunction; // ... }