2012年4月14日

函数指针

摘要: 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 jjtx 阅读(172) 评论(0) 推荐(0)

导航