stream manipulator
ios_base& skipws ( ios_base& str );
ios_base& noskipws ( ios_base& str );

Set/Unset skipws format flag
  skipws sets the format flag to skip any number of whitespaces before the next input. Tab spaces, carriage returns and blank spaces are considered whitespaces.
  noskipws unsets this flag, and considering any whitespace as part of the next input field.


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

Return Value.
  A reference to the stream object.


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

int main () {
  int n,m;
  cin >> skipws >> n;
  cin >> noskipws >> m;
  cout << n << endl << m << endl;
  return 0;

See also.
  flags, setf, unsetf
  ios_base class

© The C++ Resources Network, 2001