home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 10 / ioProg_10.iso / soft / optima / samples.z / Construc.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-30  |  506 b   |  27 lines

  1. // CONSTRUC.CPP
  2. // C++ program that illustrates constructors
  3.  
  4. #include <iostream.h>
  5.  
  6. class myComplex    // beginning of class declaration
  7. {
  8.   public:
  9.     // default constructor
  10.     myComplex();    
  11.  
  12.     // overloaded constructor
  13.     myComplex(double fReal, double fImag=0);
  14.  
  15.     // copy constructor
  16.     myComplex(myComplex& C);
  17.  
  18.     // class interface
  19.     void show();
  20.  
  21.   protected:
  22.     // internal class data
  23.     double m_fReal;
  24.     double m_fImag;
  25. };                    // end of class declaration
  26.  
  27.