#include"iostream"
using namespace std;
typedef void(*pfun)();
void fun1(){
cout<<"this is 1"<<endl;
}
void fun2(){
cout<<"this is 2"<<endl;
}
//函数接口
void funs(pfun p)
{
(*p)();
}
int main()
{
funs(fun1);
funs(fun2);
return 1;
}
C/C++函数实现接口
最新推荐文章于 2024-07-10 21:50:31 发布