#include <iostream>
using namespace std;
typedef void (*PF)();
void func()
{
cout << "func" << endl;
}
void caller( PF pf)
{
pf();
}
int main()
{
PF p = func;
caller(p);
system("pause");
return 0;
}
回调函数。高层调用了底层,底层反过来回调了顶层。lib用的是指针。回调函数是最终被调用的那个。
https://www.zhihu.com/question/19801131
来源2
链接:http://www.zhihu.com/question/19801131/answer/13005983
来源:知乎
你到一个商店买东西,刚好你要的东西没有货,于是你在店员那里留下了你