How to make the objects of my class to be used in arithmetic expressions together with the objects of standard data types?
1
Expert's answer
2010-08-04T11:11:52-0400
It all depends on which side of the arithmetic operator your object is. If on the left, then overloading of the arithmetic operators will help you. If on the right, then there are two solutions: overloading the arithmetic operators in the form of external function or transformation operators overloading. In the signature of the transformation operators you do not need to specify the return type because it is always the same as the name of the operator. For example Foo::operator long() is called when you try to convert object of class Foo to the type long.
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment