Please explain overloading arithmetic and relational operators
I vaguely understand the concept of overloading, but I do not understand how this applies to relational operators like <, <= and ==. I also do not understand how to overload addition, subtraction, multiplication and division, and I do not understand the logical reasoning behind overloading them.
Could you please explain this to me? Thank you very much!
ex: ( a*b + b*c ) / ( b*c ) Why is overloading better?*
*This is not an assignment question, but a question relating to an assignment. The assignment assumes we already understand overloading, and as this is my only independent study class, well... if I'm my own teacher and I don't understand it, how am I supposed to do the homework?
Can someone actually just write out how to overload the addition function? Just the simple stuff that I can't seem to grasp no matter how many websites I cruise. what comes in the .cpp file??
I think it starts out as const operator+ ...
but then I have no idea where it does from there in the header file, and the .cpp file is completely beyond me.
Thanks.