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";
}
}
Roosevelt
4 months agoMarquetta
4 months agoEarleen
4 months agoHassie
4 months agoLeonida
5 months agoFrancesco
5 months agoViki
5 months agoRefugia
5 months agoNieves
5 months agoSherita
5 months agoLucy
5 months agoAvery
5 months agoAlline
6 months agoGerald
6 months agoLayla
1 year agoZona
1 year agoGlendora
1 year agoAdolph
1 year agoMitsue
1 year agoJoni
2 years agoBeckie
2 years agoCallie
1 year agoWilford
1 year agoMarylou
2 years agoBobbye
2 years agoStevie
2 years agoDerick
2 years agoLuann
2 years agoNu
2 years agoPura
2 years ago