Ok, now I am having problems with overloading the + operator, it says that it cannot convert a double to a ShodaGrad, but with the = operator, it should work, shouldn't it? Here is some code...
ShodaGrad& ShodaGrad::operator = ( double value ){ MyVar = value; return *this;}ShodaGrad operator + ( const ShodaGrad &lhs, const ShodaGrad &rhs ){ double sum = lhs.value() + rhs.value(); ShodaGrad ans = sum; return ans;}ShodaGrad operator + ( const ShodaGrad &lhs, double &rhs ){ double sum = lhs.value() + rhs; ShodaGrad ans = sum; return ans;}ShodaGrad operator + ( const ShodaGrad &lhs, int &rhs ){ double sum = lhs.value() + rhs; ShodaGrad ans = sum; return ans;}
EDIT: By the way, this class, has a wierd name for one reason, my two friends took their names and meshed them together for this name ShodaGrad...they invented a number system without 0 or infinite. The way it works is the number line is actually a loop. It starts at 1/Google where Google = 10 to the one hundreth power. It gets halfway around an reaches a google. At this point, it turns into negative a google and goes down to -1/google. it forms a loop and google and -google and 1/google and -1/google meet.
<-
Digital Explosions ->
"Discipline is my sword, faith is my shield
do not dive into uncertainty, and you may live to reap the rewards" - (Unreal Championship)
[edited by - Krisc on January 17, 2003 4:23:11 PM]