函数指针
来源:互联网 发布:矩阵优化问题 编辑:程序博客网 时间:2024/06/05 14:50
#include <iostream>using namespace std;int inc(int a){return (++a);}int multi(int *a, int *b, int *c){return (*c = *a * *b);}typedef int(FUNC1)(int in);typedef int(FUNC2)(int*, int*, int*);void show(FUNC2 fun, int arg1, int* arg2){FUNC1 *p = &inc;int temp = p(arg1);fun(&temp, &arg1, arg2);printf("%d\n", *arg2);}int main(){int a;show(multi, 10, &a);return 0;}输出为110
0 0
- 指针函数 函数指针
- 函数指针/指针函数
- 指针函数&函数指针
- 函数指针 指针函数
- 函数指针 指针函数
- 指针函数,函数指针
- 函数指针,指针函数,
- 指针函数,函数指针
- 函数指针 指针函数
- 函数指针、指针函数
- 指针函数&函数指针
- 函数指针 指针函数
- 函数指针 指针函数
- 函数指针&指针函数
- 指针函数 函数指针
- 指针函数 &函数指针
- 函数指针&指针函数
- void指针 函数指针
- Compare Version Numbers
- Foundation -- OC集合 --NSArray
- 一个空格引发的惨剧
- window 查看IP地址、网管、子网掩护、DNS等信息
- 设置VMWARE通过桥接方式使用主机无线网卡上网
- 函数指针
- Foundation -- OC集合 --NSSet
- 基于asio实现pop3的几个指令
- Performance between Sets and List
- 黑马程序员——反射
- P51第15题
- 偏底层(深入)的一些概念整理
- PC用Kinect玩水果忍者核心代码
- __asm__ __volatile__