showpoint/noshowpoint
stream manipulator
ios_base& showpoint ( ios_base& str );
ios_base& noshowpoint ( ios_base& str );
ios_base
  cplusplus.com  

Set/Unset showpoint format flag
  showpoint sets the format flag to always show the decimal point when representing floating-point values.
  noshowpoint unsets this flag, inserting the decimal point only when necessary.

Parameters.

str
Stream object where to apply. This is a manipulator parameter.

Return Value.
  A reference to the stream object.

Example.

// modify showpoint flag
#include <iostream>
using namespace std;

int main () {
  double d, pi;
  d=10.0;
  pi=3.1416;
  cout.precision (5);
  cout << hex << showpoint << d << '\t' << pi << endl;
  cout << hex << noshowpoint << d << '\t' << pi << endl;
  return 0;
}
The execution of this example shall display:
 10.000  3.1416
 10      3.1416

See also.
  flags, setf, unsetf
  ios_base class


© The C++ Resources Network, 2001