"Al-Burak" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> 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?

Your compiler just told you: you're trying to use
an operator with a type for which it's not valid.

-Mike


_______________________________________________
Help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to