函数指针的使用

来源:互联网 发布:叮叮当软件下载 编辑:程序博客网 时间:2024/05/21 09:02
#include <stdio.h>typedef int(FUNCTION)(int);int f(int i){    return i;}void f1(){    printf("hello world!\n");}int main(void){    FUNCTION* func = f;    printf("%d\n",func(13));    void(*pf)() = &f1;  //老的编译器使用的方法;新的编译器的使用方法:void(*pf)() = f1;    pf();     //新的编译器使用的方法,函数调用方法    (*pf)();  //老的编译器使用的方法,函数调用方法    printf("---end---\n");    return 0;}
0 0
原创粉丝点击