Whats wrong with my code shown below? please somebody throw some light. Thanks for your time !
#include<iostream.h> using namespace std; struct mydata{ int mx; mydata(int x = 0){} mydata operator+(const mydata& rhs){ mydata temp(rhs); return temp; } operator int() const{ return mx; } operator double() const{ return mx; } }; int main(){ mydata d; mydata r = d + 5; // L1 5 + d; // L2 d + d; // L3 }
#include<iostream.h>? Are you using turbo c++?