Operator Overloading

Home Forums C Programming Operator Overloading

This topic contains 0 replies, has 1 voice, and was last updated by  sameena 12 years, 8 months ago.

  • Author
    Posts
  • #1900

    sameena
    Member

    Hi

    Doing a course in C++.Net which upto now has been ok and interesting. However Operator Overloading is confusing me to a great deal. There is plenty written on the subject but for Computer Scientists who just love mathematics and complicated text! To find something simple – it does not exist. I can use operator overloading like a parrot but I want to know what exactly is going on…how does the compiler treat an overloaded operator…etc.

    We were asked to make an Exponent class that will allow us to overload the ^ operator so that we can perform exponential notation so that you can have iResult=iNumber ^10 where iNumber equals 10 so that iResult equals 1000. This is my zillionth attempt but the overloaded function is not called..please help.

    This is the class:

    Thanks in advance

You must be logged in to reply to this topic.

0 Shares
Share
+1
Tweet
Share
Stumble