diff --git a/cnumber.hpp b/cnumber.hpp index 81b0e29..09e7e79 100644 --- a/cnumber.hpp +++ b/cnumber.hpp @@ -28,7 +28,11 @@ class cnumber { // Operators cnumber operator+(const cnumber &that) { - cnumber z(that.r + this->r, that.i + this->i); + cnumber z(this->r + that.r, this->i + that.i); + return z; + } + cnumber operator-(const cnumber &that) { + cnumber z(this->r - that.r, this->i - that.i); return z; } cnumber operator*(const cnumber &that) {