Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 08 / Complex / Complex.h
diff options
context:
space:
mode:
Commit1cf7542f449ec0d2081e6257a836ebfc544b2ad1 (patch)
Author
 angeld55 <angel_dimitriev@abv.bg>
2021-04-16 22:38:54 +0300
Committer
 angeld55 <angel_dimitriev@abv.bg>
2021-04-16 22:38:54 +0300
Files4f9a39150c787de2ea94461b9e53b5b094730f84 /Sem. 08/Complex/Complex.h
Object-oriented_programming_FMI-1cf7542f449ec0d2081e6257a836ebfc544b2ad1.tar
Object-oriented_programming_FMI-1cf7542f449ec0d2081e6257a836ebfc544b2ad1.tar.gz
Object-oriented_programming_FMI-1cf7542f449ec0d2081e6257a836ebfc544b2ad1.zip
Parentb9df311eb4e479c150eeb112df91a3ce4dd111ba (diff)
Parent9aa9147fcc7d0469262ac02071a8c9fc54734d27 (diff)
Merge branch 'master' of https://github.com/Angeld55/Object-oriented_programming_FMI
1 files changed, 34 insertions, 0 deletions
-rw-r--r--Sem. 08/Complex/Complex.h34
diff --git a/Sem. 08/Complex/Complex.h b/Sem. 08/Complex/Complex.h
index e69de29..d76a2f3 100644
--- a/Sem. 08/Complex/Complex.h
+++ b/Sem. 08/Complex/Complex.h
@@ -0,0 +1,34 @@
+#include <iostream>
+class Complex
+{
+private:
+ double real;
+ double im;
+
+public:
+ Complex();
+ Complex(double real, double im);
+
+ Complex getConjugated() const; //връща комплексно спрегнатото число на текущия обект.
+
+ //assignment operators
+ // a+=b Към а се добавя стойността на b. а се променя , b не се. Операцията ще върне a за да може да се правят верижни изрази (a+=b+=c)
+ Complex& operator+=(const Complex&);
+ Complex& operator-=(const Complex&);
+ Complex& operator*=(const Complex&);
+ Complex& operator/=(const Complex&);
+
+
+
+ //stream opeartors ( std::cout>> c1) (std::cin<<c1 )
+ friend std::ostream& operator<<(std::ostream&, const Complex&);
+ friend std::istream& operator>>(std::istream&, Complex&);
+
+};
+// a+b. Операторът връща НОВА променлива(Complex), която е резултатът от операцията.
+Complex operator+(const Complex&, const Complex&);
+Complex operator-(const Complex&, const Complex&);
+Complex operator*(const Complex&, const Complex&);
+Complex operator/(const Complex&, const Complex&);
+
+