Srxon05

cmt Complex.hpp

Nov 15th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.13 KB | None | 0 0
  1. #ifndef KOMPLEX_HPP_INCLUDED
  2. #define KOMPLEX_HPP_INCLUDED
  3.  
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. class Complex
  8. {
  9. private:
  10.     double real;
  11.     double imag;
  12. public:
  13.     Complex();
  14.     Complex(double,double);
  15.     Complex(const Complex&);
  16.     double getReal() const;
  17.     double getImag() const;
  18.     void setReal(double);
  19.     void setImag(double);
  20.     Complex& operator=(const Complex&);
  21.     Complex& operator+=(const Complex&);
  22.     Complex& operator-=(const Complex&);
  23.     Complex& operator*=(const Complex&);
  24.     Complex& operator/=(const Complex&);
  25.     Complex& operator++();
  26.     Complex operator++(int);
  27.     friend Complex operator+(const Complex&, const Complex&);
  28.     friend Complex operator-(const Complex&, const Complex&);
  29.     friend Complex operator*(const Complex&, const Complex&);
  30.     friend Complex operator/(const Complex&, const Complex&);
  31.  
  32.     friend bool operator==(const Complex&, const Complex&);
  33.     friend bool operator!=(const Complex&, const Complex&);
  34.     friend ostream& operator<<(ostream&, const Complex&);
  35.     friend istream& operator>>(istream&, Complex&);
  36. };
  37.  
  38.  
  39. #endif // KOMPLEX_HPP_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment