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
4 months agoZona
3 months agoGlendora
3 months agoAdolph
4 months agoMitsue
4 months agoJoni
5 months agoBeckie
5 months agoCallie
4 months agoWilford
5 months agoMarylou
5 months agoBobbye
5 months agoStevie
5 months agoDerick
5 months agoLuann
5 months agoNu
5 months agoPura
5 months ago