| 2.2.3.3.1 complex::complexcomplex
 DescriptionDefault constructor which constructs a complex value with both the real and the imaginary part being zero.
 Constructor which constructs a complex value with  the only one argument such that the real part becomes the value of the argument and the imaginary part is zero.
 Constructor which constructs a complex value from the real and imaginary values.
 Constructor which constructs a complex value from another complex value.
 Syntaxcomplex( ) 
 complex( double dReal ) 
 complex( double dReal, double dImaginary ) 
 complex( complex cc ) Parameters dRealthe real part
  dRealthe real part
  dImaginarythe imaginary part
  ccthe source complex value
 ReturnExamplesEX1
 void    complex_ex1()
{
    complex        c;
    
    // Display the value:
    out_complex("value = ", c); // Result is "value = 0.000000+0.000000i"
}EX2
 void    complex_ex2()
{
    complex        c(7.89);
    
    // Display the value:
    out_complex("value = ", c); // Result is "value = 7.890000+0.000000i"
}EX3
 void    complex_ex3()
{
    complex        c(3.45, 6.78);
    
    // Display the value:
    out_complex("value = ", c); // Result is "value = 3.450000+6.780000i"
}EX4
 void    complex_ex4()
{
    complex        cc(1.2, 3.4);
    complex        c(cc);
    
    // Display the value:
    out_complex("value = ", c); // Result is "value = 1.200000+3.400000i"
}RemarkSee AlsoHeader to Includeorigin.h
 |