共用方式為


complex::value_type

A type that represents the data type used to represent the real and imaginary parts of a complex number.

typedef Type value_type;

Remarks

value_type is a synonym for the class complex Type template parameter.

Example

// complex_valuetype.cpp
// compile with: /EHsc
#include <complex>
#include <iostream>

int main( )
{
   using namespace std;
   complex <double>::value_type a = 3, b = 4;
   
   complex <double> c1 ( a , b );
   cout << "Specifying initial real & imaginary parts"
      << "\nof type value_type: "
      << "c1 = " << c1 << "." << endl;
}
Specifying initial real & imaginary parts
of type value_type: c1 = (3,4).

Requirements

Header: <complex>

Namespace: std

See Also

Reference

complex Class