【发布时间】:2015-08-27 20:03:43
【问题描述】:
我想重新定义
+
操作员。
所以,我做了一个简单的代码,如下面的代码。
int operator+(const int &a, const int &b)
{
int temp = a-b;
return temp;
}
int main()
{
int a = 10;
int b = 5;
cout << a+b << endl;
}
我可以用 Class 类型重新定义...但我不想使用 Class。
我该如何解决这个问题?
【问题讨论】: