您的位置:首页 > 其它

回调函数

2015-07-23 16:50 190 查看
自己定义一函数Printtest,实现函数的功能,再定义另一个callback函数,通过callback函数中的函数变量,来找到Printtestt的函数地址,在主函数中用Callback来实现函数功能。

#include "stdio.h"

#include "stdax.h"

void Printtest(*s){

printf(s);

}

void Callback(void (*Print())(char*),char *s){

Print(s);

}

main(int argc , char *argv[]){

Callback(Printtest,"HelloWorld");

return 0;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: