Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. //complex.h
  2. #pragma once
  3. class complex {
  4. private:
  5.     double real;
  6.     double imaginary;
  7. public:
  8.     complex(double, double);
  9.     double Real() const;
  10.     double Imaginary() const;
  11. };
  12.  
  13.  
  14. //complex.cpp
  15.  
  16. #include "complex.h"
  17. using namespace std;
  18.  
  19. class complex  {
  20.   private:
  21.       double real;
  22.       double imaginary;
  23.   public:
  24.      complex (double r = 0.0, double i = 0.0) :  real(r), imaginary(i) {  }
  25.     double Real () const { return real; }
  26.     double imaginary () const { return imaginary; }
  27. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement