码迷,mamicode.com
首页 > 编程语言 > 详细

C语言——指针

时间:2017-05-15 14:14:12      阅读:121      评论:0      收藏:0      [点我收藏+]

标签:int   函数   blog   include   main   stdio.h   c语言   print   style   

指向函数的指针:

#include <stdio.h>
int func(int a)
{
    return -1;
}
int function(int a)
{
    return a;
}
int main()
{
    int (*p1)(int) = func;
    printf("%d\n", p1(1));
    p1 = function;
    printf("%d\n", p1(100));
}

 

C语言——指针

标签:int   函数   blog   include   main   stdio.h   c语言   print   style   

原文地址:http://www.cnblogs.com/quanxi/p/6855903.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!