Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit333283d165dab16a7d55209cf92d65efd13af3af (patch)
Author
 Angel Dimitriev <angel_dimitriev@abv.bg>
2022-04-12 19:31:40 +0300
Committer
 GitHub <noreply@github.com>
2022-04-12 19:31:40 +0300
Filesaa52117970c138d4232476006baa7d9d46faea25
Object-oriented_programming_FMI-333283d165dab16a7d55209cf92d65efd13af3af.tar
Object-oriented_programming_FMI-333283d165dab16a7d55209cf92d65efd13af3af.tar.gz
Object-oriented_programming_FMI-333283d165dab16a7d55209cf92d65efd13af3af.zip
Parent9b628894a2fc15659232390c4459db7c86c8c8f1 (diff)
Update Complex.h
1 files changed, 32 insertions, 1 deletions
-rw-r--r--Sem. 08/Complex/Complex.h33
diff --git a/Sem. 08/Complex/Complex.h b/Sem. 08/Complex/Complex.h
index 4bcfe98..5de1e14 100644
--- a/Sem. 08/Complex/Complex.h
+++ b/Sem. 08/Complex/Complex.h
@@ -1 +1,32 @@
-d
+#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&);