#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;
}
/*回调函数即用函数指针指向被调函数,实现函数的回调*/
/*有参函数的回调*/
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;
}
/*回调函数即用函数指针指向被调函数,实现函数的回调*/