您的位置:首页 > 其它

函数回调(有参数)

2015-09-25 16:30 190 查看
#include<iostream>

/*有参函数的回调*/

void print(char* s)

{

std::cout << s << std::endl;

}

void callPrint(void(*callfuct)(char*),char* s)

{

callfuct(s);

}

int main_huidiao(int argc, char **argv)

{

callPrint(print,"hello\n");

return 0;

}

/*回调函数即用函数指针指向被调函数,实现函数的回调*/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: