函数指针
摘要:
1、常见的用法#include <stdio.h> typedef int (*PFUN)(int, int); // PFUN 是函数指针类型 int fun(int a, int b)
{ return a + b;
} int main(void)
{ PFUN pf = fun; // 或 PFUN pf = &fun; printf("%d\n", pf(1, 2)); printf("%d\n", (*pf)(1, 2)); return 0;
}2、第二种用法#include <stdio.h> typede 阅读全文
posted @ 2012-04-14 14:50 c语言源码 阅读(202) 评论(0) 推荐(0)
浙公网安备 33010602011771号