typedef int(*FuncPtr)(int, int); 定义完该函数指针之后,可以使用它来代表相应类型的函数,例如: 复制int Sum(int a, int b) { return a + b; } FuncPtr ptr = Sum; int result = ptr(2, 3); // result = 5
int Sum(int a, int b) { return a + b; } FuncPtr ptr = Sum; int result = ptr(2, 3); // result = 5
收藏0 举报
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
196
3261
2
扫码关注 21ic 官方微信
扫码关注嵌入式微处理器
扫码关注电源系统设计
扫码关注21ic项目外包
扫码浏览21ic手机版
本站介绍 | 申请友情链接 | 欢迎投稿 | 隐私声明 | 广告业务 | 网站地图 | 联系我们 | 诚聘英才
京公网安备 11010802024343号