C examples for complex.h:constructor
public member function
<complex> <complex.h>
Complex number constructor
template<class U> complex (const complex<U>& x); complex (const T& re = T(), const T& im = T()); complex (const complex& x);
#include <iostream> // std::cout #include <complex> // std::complex int main ()//from www . j a v a 2 s .c o m { std::complex<double> first (2.0,2.0); std::complex<double> second (first); std::complex<long double> third (second); std::cout << third << '\n'; return 0; }