_DecimalT Class Template Input and Output

Both the standard (no extension) and USL (.h extension) headers can be used for input/output of _DecimalT objects. To use the C <stdio> formatted input/output functions, specify the %D(n,p) type format used for the C language internally defined decimal type.

Assuming that you are using header files with a .h extension:
  • Use the cout pre-defined stream to print a _DecimalT class template value.
  • Use the cin pre-defined stream to read a _DecimalT class template value.
Note: If you are using header files without an extension (such as <stdio>), use the stdout and stdin pre-defined streams.

To print the value of a _DecimalT class template, you can use the fprintf(), printf(), sprintf(), vfprintf(), vprintf(), or vsprintf() functions.

To read the value of a _DecimalT class template, you can use the fscanf(), scanf(), or sscanf() functions.