Operator Overloading
C actually does operator overloading, you just can’t control it!
a = 4 + 5; // integer math
b = 4.3 + 5.4; // floating point math
- C++ lets you define your own operators
date today, last_week(3, 5);
int days_passed = last_week - today;
- Operators can return other types, too
complex a(4.0, 5.0), b(1.0, 2.0), c(0.0, 0.0);