What happens when you attempt to compile and run the following code?
#include
#include
using namespace std;
class complex{
double re;
double im;
public:
complex() : re(1),im(0.4) {}
bool operator==(complex &t);
};
bool complex::operator == (complex &t){
if((this?>re == t.re) && (this?>im == t.im))
return true;
else
return false;
}
int main(){
complex c1,c2;
if (c1==c2)
cout << "OK";
else {
cout << "ERROR";
}
}
Layla
9 months agoZona
8 months agoGlendora
8 months agoAdolph
9 months agoMitsue
9 months agoJoni
9 months agoBeckie
10 months agoCallie
9 months agoWilford
9 months agoMarylou
9 months agoBobbye
9 months agoStevie
10 months agoDerick
9 months agoLuann
10 months agoNu
10 months agoPura
10 months ago