回调函数的使用2
来源:互联网 发布:跳蚤街 淘宝二手市场 编辑:程序博客网 时间:2024/06/07 21:31
为了降低函数的圈复杂度,可以通过查表来调用函数:
#include <stdio.h>
#if 1
typedef int (*pfCallBack)();
int test1()
{
int i = 0;
i++;
printf("%d",i);
return 1;
}
int test2()
{
int i = 1;
i++;
printf("%d",i);
return 1;
}
int test3()
{
int i = 2;
i++;
printf("%d",i);
return 1;
}
int main()
{
pfCallBack table[]={test1,test2,test3};
table[0]();
return 1;
}
#endif
#include <stdio.h>
#if 1
typedef int (*pfCallBack)();
int test1()
{
int i = 0;
i++;
printf("%d",i);
return 1;
}
int test2()
{
int i = 1;
i++;
printf("%d",i);
return 1;
}
int test3()
{
int i = 2;
i++;
printf("%d",i);
return 1;
}
int main()
{
pfCallBack table[]={test1,test2,test3};
table[0]();
return 1;
}
#endif
- 回调函数的使用2
- 回调函数的使用
- 回调函数的使用
- 回调函数的使用
- 回调函数的使用
- 回调函数的使用
- 回调函数的使用
- 回调函数的使用
- 回调函数的使用
- 回调函数的使用
- 回调函数的使用
- 回调函数的使用
- 回调函数的使用
- 使用回调函数
- 回调函数使用
- Android_回调函数的使用(2)
- 轻松使用自己的回调函数
- 轻松使用自己的回调函数
- Web框架、MVC和ASP.NET
- Visio 2007 For Dummies
- Microsoft(R) Operations Manager 2005 Unleashed (MOM): With A Preview of Operations Manager 2007 (Unl
- showModalDialog和showModelessDialog使用心得
- Microsoft Excel Functions and Formulas: Excel 97--Excel 2003
- 回调函数的使用2
- Struts 2 拦截器底层实现原理 学习笔记
- Embedded Java Security: Security for Mobile Devices
- ARP欺骗病毒攻击
- Professional ASP.NET 2.0 Databases
- osworkflow与Oracle数据连接配置
- n个对象中取得m个对象组合的算法
- Json升级带来的影响
- 算法的测试人员很强大