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