准备:打开C语言的教材,仔细阅读指向函数的指针那章,也叫函数指针。最好是K&R的经典的《The C Programming Language》,因为它的用例好,不象谭好强的书里所用的例子纯粹是为教学而写的。
关于函数指针,在此只引用《The C Programming Language》在函数指针这一节中的第一段话:
In C, a function itself is not a variable, but it is possible to define pointers to functions, which can be assigned, placed in arrays, passed to functions, returned by functions, and so on.