64,691
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <string.h>
using namespace std;
class Test
{
public:
Test();
Test(int value);
friend int operator + (Test &t1 , Test &t2);
private:
int m_value;
};
Test::Test()
{
m_value = 0;
}
Test::Test(int value)
{
m_value = value;
}
int operator + (Test &t1 , Test &t2);
{
return t1.m_value + t2.m_value;
}
int main(int argc, char* argv[])
{
return 0;
}
int operator + (Test &t1 , Test &t2);//多了个;
{
return t1.m_value + t2.m_value;
}