Advertisement
Guest User

Complex.h

a guest
Oct 19th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #pragma once
  2.  
  3.  
  4. class Complex
  5. {
  6.     double _im;
  7.     double _re;
  8. public:
  9.     Complex();
  10.     Complex(double re, double im);
  11.     double getIm() const;
  12.     double getRe() const;
  13.     void setIm(double im);
  14.     void setRe(double re);
  15.  
  16.     // operators
  17.     Complex & operator+=(const Complex & other);
  18.     Complex  operator+(const Complex & other)const ;
  19.     double operator[](int number)  const;
  20.     bool operator!=(const Complex& other) const;
  21.     bool operator==(const Complex& other) const;
  22.     Complex & operator++(); //pre
  23.     Complex operator++(int); //post
  24.     void operator()(double re, double im);
  25.     Complex & operator=(const Complex& other);
  26. };
  27.  
  28.  
  29. Complex & operator+ (Complex& complex, const double & d);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement