回调函数
来源:互联网 发布:卡盟主站源码 编辑:程序博客网 时间:2024/04/30 12:39
#include <stdlib.h>
#include <stdio.h>
int Test1()
{
int i;
for (i=0; i<30; i++)
{
printf("The %d th charactor is: %c\n", i, (char)('a' + i%26));
}
return 0;
}
int Test2(int num)
{
int i;
for (i=0; i<num; i++)
{
printf("The %d th charactor is: %c\n", i, (char)('a' + i%26));
}
return 0;
}
void Caller1(int (*ptr)())//指向函数的指针作函数参数
{
(*ptr)();
}
// void Caller2(int n, int (*ptr)())//指向函数的指针作函数参数,这里第一个参数是为指向函数的指针服务的,
// {
// // //不能写成void Caller2(int (*ptr)(int n)),这样的定义语法错误。
//
// (*ptr)(n);
// return;
//
// }
int main()
{
printf("************************\n");
Caller1(Test1); //相当于调用Test2();
printf("&&&&&&************************\n");
// Caller2(30,Test2); //相当于调用Test2(30);
int j;
scanf("%d",&j);
return 0;
}
- .NET 回调函数
- 回调函数
- 回调函数
- 回调函数概念
- 回调函数
- 回调函数
- 回调函数
- 回调函数 相关
- delphi 回调函数
- 回调函数
- 回调函数
- 回调函数学习
- 回调函数
- 关于回调函数
- 透析回调函数
- 回调函数
- 什么是回调函数
- 回调函数
- The Microsoft.Jet.OLEDB.4.0 provider is not registered on the local machine (zz)
- bat 遍历lib文件夹,运行JAR包
- 今天 是怎么回事
- 脑筋急转弯练习 【找假金子】
- 《编程之美》数组分割问题——个人想法和证明
- 回调函数
- TelephoneManager类
- 调用系统程序打开指定的图片
- 盛大云数据丢失问题说明云的用户应该能够监控云的运行
- 探寻C++最快的读取文件的方案
- linux下查看系统io情况
- Eclipse 中 SVN 的设置。
- eclipse使用技巧
- mysql 外键