Export (0) Print
Expand All

noskipws

Cause spaces to be read by the input stream.

ios_base& noskipws( 
   ios_base& _Str 
);

_Str

A reference to an object of type ios_base, or to a type that inherits from ios_base.

A reference to the object from which _Str is derived.

By default, skipws is in effect. When a space is read in the input stream, it signals the end of the buffer.

The manipulator effectively calls _Str.unsetf(ios_base::skipws), and then returns _Str.

// ios_noskipws.cpp
// compile with: /EHsc
#include <iostream>
#include <string>

int main() {
   using namespace std;   
   string s1, s2, s3;
   cout << "Enter three strings: ";
   cin >> noskipws >> s1 >> s2 >> s3;
   cout << "." << s1  << "." << endl;
   cout << "." << s2 << "." << endl;
   cout << "." << s3 << "." << endl;   
}

Header: <ios>

Namespace: std

Show:
© 2014 Microsoft