I declared to overloaded operators, '='. One takes unsigned long, the other takes a double.
Now the problem is the compiler can't tell which function I want to use when passing 0.
example:
long ClassX::operator= (double test)
{
long result=0;
//do testing
return result;
}
long ClassX::operator= (unsigned long test)
{
long result=0;
//do testing
return result;
}
//some code later in main
ClassX xclass;
xclass=0;
This causes Ambigous error, it doens't know if i mean double or unsigned long.
Is there a way to specify which to use as default? or is there another solution?