What is unary operator overloading? | SoloLearn: Learn to code for FREE!


What is unary operator overloading?

6/23/2018 6:06:04 AM

jose kamau

4 Answers

New Answer


sammy what do you want to know?


unary operators are ! + - for most languages such as !true, +5, -4. Operator overloading allows you to make operators have a method of your class. I have a full set of operator overloading examples for each language that runs here and supports it. Since your taking C++ to the point you might understand it, I'll link my version. The comments will get you to all the others. https://code.sololearn.com/cStdw0OPtPxG


Line 28 declares my unary + operator, lines 118 to 121 gives it's implementation, and line 200 makes use of it.


wanna know??