c++回调函数

来源:互联网 发布:淘宝商品复制到微店 编辑:程序博客网 时间:2024/06/07 21:11

c++回调函数主要需使用函数指针实现。
// 宏定义函数指针
typdef void (test)(char s);

//实际调用函数
void myTest(char*s)
{
printf(s);
}

void main()
{
test t = myTest;
t(“this is a test”);
}

0 0
原创粉丝点击