64,639
社区成员
发帖
与我相关
我的任务
分享
void __stdcall Notify(int _iID,int _iState);
int ClassXXX::Test()
{
//该如何调用Notify呢?直接调?还是再定义一个调用的函数之类的?
}
#include <iostream>
using namespace std;
typedef int (__stdcall *Func) (int,int);
int Calc(int x, int y, Func func)
{
int sum;
sum = func(x, y);
return sum;
}
int _stdcall Add(int a, int b)
{
return a + b;
}
int _stdcall Sub(int a, int b)
{
return a - b;
}
int main()
{
int a, b;
cout<<"Please input the first integer:"<<endl;
cin>>a;
cout<<"Please input the second integer:"<<endl;
cin>>b;
int m, n;
m = Calc(a, b, Add);
n = Calc(a, b ,Sub);
cout<<a<<"+"<<b<<"="<<m<<endl;
cout<<a<<"-"<<b<<"="<<n<<endl;
system("pause");
return 0;
}