函数指针奇怪的地方
来源:互联网 发布:node forever 启动 编辑:程序博客网 时间:2024/05/21 18:34
如下代码:
int add(int a, int b)
{
return (a+b);
}
int sub(int a, int b,int c)
{
c= c + 1;
return (a-b);
}
void main()
{
typedef int (*padd)(int, int);
typedef int (*psub)(int, int, int);
int ret;
padd fun = (padd)sub;
ret = fun(2,3);
}
结果ret的值为-1。可是sub明明要接受三个参数才可以啊?不明白为什么
- 函数指针奇怪的地方
- GDI+奇怪的地方
- Go语言用defer定义函数比较奇怪的地方
- 奇怪的 this 指针
- 一个奇怪的BCB的函数指针调用
- C++的函数对象优于函数指针地方
- python的奇怪小地方 in numpy
- <script>结束符奇怪的地方
- 奇怪的 this 指针 (续)
- 奇怪的atoi函数!
- 奇怪的函数
- 奇怪的recv函数
- XDOJ1179 - 奇怪的函数
- 奇怪的函数
- 奇怪的函数
- LuoguP2759奇怪的函数
- 奇怪的函数 题解
- 奇怪的小函数
- Android Activity的加载模式和onActivityResult方法之间的冲突
- mtk4.0在linux12.04环境下gcc为4.4.7下编译出错
- json数据格式
- shell变量_$#,$@,$0,$1,$2的含义解释
- templete_LIS
- 函数指针奇怪的地方
- GCC编译器是如何找到头文件的
- How can I work around hidesBottomBarWhenPushed acting weird with the iOS 6 SDK?
- 关于hadoop的安全模式
- udp协议总结
- [剑指offer][面试题12]打印1到最大的n位数
- xulrunner弹出窗口不显示解决方法
- IE和FF下空格宽度不一致
- 分享---10 套华丽的 CSS3 按钮推荐