home *** CD-ROM | disk | FTP | other *** search
- // "Using this pointers" -- THIS.HPP
- // This program illustrates the use of the 'this' pointer
-
- #include <iostream.h>
-
- class myComplex
- {
- public:
- myComplex(double fReal = 0, // constructor
- double fImag = 0);
-
- void setReal(double fReal)
- { m_fReal = fReal; }
- void setImag(double fImag)
- { m_fImag = fImag; }
-
- void show(); // display contents
-
- myComplex& operator =(myComplex& C);
- myComplex& operator =(double fReal);
-
- protected:
- double m_fReal; // real part
- double m_fImag; // imaginary part
- };
-
-
-