O'Reilly logo

SAMS Teach Yourself C++ in 10 Minutes SECOND EDITION by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendex A. Operators

The table in this appendix lists and describes the many operators of the C++ language. Many of these operators are available for overloading in your classes.

When overloading the operators, you are not restricted to the types indicated here. Often the type will be your class. You can also overload any infix operator more than once to work with different types, but remember that the return type is not part of what differentiates two overloads.

Operator Name/Meaning Works On Overload Example Reads As
Arithmetic Operators
+ Add Numeric and char Y a+b Add a and b to produce a result
- Subtract Numeric and char Y a-b Subtract b from a to produce a result
* Multiply Numeric and char Y a*b Multiply a by b to produce a result

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required