다음을 통해 공유


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;   
}

입력

1 2 3

샘플 출력

.1.
..
..

요구 사항

Header: <ios>

네임스페이스: std

참고 항목

참조

iostream 프로그래밍

iostreams 규칙