C++:複数クラス構築関数、コピー構築、演算子リロード、解析関数


#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;


class Complex
{
public:
    void Set(double real, double image)
    {
        _real = real;
        _image = image;
    }

    //    
     Complex(double real = 1, double image = 2)
    {
         cout << "      " << endl;
        _real = real;
        _image = image;
    }

     //      
     Complex(Complex& d)
     {
         _real = d._real;
         _image = d._image;
     }


     //    
     ~Complex()
     {
         cout << "    " << endl;
     }

     //

     void Display()
     {
         cout << _real << _image;
     }


     //  
     bool operator==(const Complex& d)
     {
         return _real  * _real + _image * _image
             == d._real + d._real + d._image * d._image;
     }

     //  
     bool operator < (const Complex& d)
     {
         return _real  * _real + _image * _image
             < d._real + d._real + d._image * d._image;
     }

     //  
     bool operator > (const Complex& d)
     {
         return _real  * _real + _image * _image
             > d._real + d._real + d._image * d._image;
     }
private:
    double _real;
    double _image;
};


int main()
{
    Complex d1;
    d1.Display();
    return 0;
}