help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

help with operator%


From: Al-Burak
Subject: help with operator%
Date: 19 Oct 2005 18:58:25 -0700
User-agent: G2/0.2

In the program
--- money.hpp
namespace jme{
   class Money{
      protected: float amount;
      ...
      public: friend jme::Money jme::operator%( jme::Money&,
jme::Money&);
};
}
--- money.cpp
jme::Money jme::operator%(jme::Money& lhs, jme::Money& rhs){
   jme::Money tmp;
   return tmp = lhs.amount % rhs.amount;
}

I get an error message, that reads:
Project   : Money
Compiler  : GNU GCC Compiler (called directly)
Directory : c:\money\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: money.cpp
money.cpp: In function `jme::Money jme::operator%(jme::Money&,
jme::Money&)':
money.cpp:72: error: invalid operands of types `float' and `float' to
binary `operator
--------------------------------------------------------------------------------
What am I doing wrong?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]