// // Created by tang on 2022/6/13. //
#include <iostream> using namespace std; typedef int(*CallBack)(char *p);//声明CallBack 类型的函数指针 int A(char *p) { cout<<"A"<<endl; cout<<p<<endl; return 0; } int B(CallBack lpCall,char *p) { cout<<"B"<<endl; cout<<p<<endl; lpCall(p); //借助回调完成的功能,也就是A函数来处理的. return 0; } int main() { char *p="hello!"; B(A,p); }