16,747
社区成员




#include <stdio.h>
#include <iostream>
using namespace std;
typedef struct _CallBackFunction
{
int (__cdecl *OnUserLogin)(int iEventType, const char* UserName);
int (__cdecl *OnUserLogout)(int iEventType, const char* UserName);
}CallBackFunction;
int UserLogin(int iEventType, const char* UserName)
{
cout<<UserName<<endl;
return 0;
}
int main()
{
CallBackFunction a;
a.OnUserLogin = UserLogin;
a.OnUserLogin(2, "test");
return 0;
}