noskipws

创建空间由读取输入流。

ios_base& noskipws( 
   ios_base& _Str 
);

参数

  • _Str
    引用类型到 ios_base对象,或者从 ios_base继承的类型。

返回值

为_Str 派生的对象的引用。

备注

默认,skipws 实际上是。 在空间写入内容时,发出信号缓冲区的末尾。

操控程序有效调用 _Str.unsetf(ios_base::skipws),然后返回 _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;   
}

输入

1 2 3

示例输出

.1.
..
..

要求

页眉: <ios>

命名空间: std

请参见

参考

iostream 编程

iostreams 约定