5.3. ___________________________________________137

{ cout  real  " + "  imag  "i ";}

private:

double real, imag;

} ;

inline void complex::assign(double r, double i = 0.0)
{

real = r;

imag = i;

}

    :

  complex2.cpp

class complex {
public:                               //  ,

void assign (double r, double i);  //. 

void print()

{ cout  real  " + "  imag  "i ";}
private:

double real, imag;

i    .

inline void complex::assign(double r, double i = 0.0)
{

real = r;

imag = i ;

}

   :

class complex {           // , 

double real, imag;      // 
public:

void assign (double r, double i);

void print()

{ cout  real  " + "  imag  "i ";}
};

   ,         -
.       ,    
 .         
      ,    . 
     (need-to-know style),    
   ,       
   .

          
complex   4.5,  ,   115?   -