64 593
Assignments Done
99,2%
Successfully Done
In September 2018

Answer to Question #527 in C++ for Miike Masura

Question #527
I am developing a class for working with long arithmetic. How do I make my class support arithmetic operations between its objects?
Expert's answer
To do this you have to overload the arithmetic operators for your class. For example: the signature of overloading the operator "+" in the form of function of class Foo& Foo:: operator + (const Foo& f). Note that for the operators +=, -=, *=, /= you have to return *this for your overloaded operator to be used in the expressions like a += b + c.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions