不管相不相等输出结果都一样,怎么弄
struct Complex
{
int real;
int image;
};
#include<iostream>
bool operator==(Complex x, Complex y)
{
return x.real == y.real&&x.image == y.image;
}
int fun(Complex* x, Complex* y);
int main()
{
using std::cout;
Complex a = { 180,8};
Complex b = { 18,78};
cout << fun(&a, &b);
return 0;
}
int fun(Complex* x, Complex* y)
{
return x == y ?1 : -1;
}