I want to do a
integer = class
I tried creating this function.
However when I try to do a
I get this
I am pretty new to operator overloading but I understand the basic concepts.
Any hints?
integer = class
I tried creating this function.
Code:
int Number::operator= (const Number rightvalue)
{
return rightvalue.self;
}
However when I try to do a
Code:
int temp(0);
temp = mynumber;
I get this
Code:
error C2440: '=' : cannot convert from 'Number' to 'int'
1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
I am pretty new to operator overloading but I understand the basic concepts.
Any hints?