basic_istream::ignore

현재 읽기 위치에서 건너뛸 요소 수의 원인.

basic_istream<Elem, Tr>& ignore(
    streamsize _Count = 1,
    int_type _Delim = traits_type::eof( )
);

매개 변수

  • _Count
    현재 읽기 위치에서 건너뛸 요소 수입니다.

  • _Delim
    카운트 하기 전에 발생 하는 경우 발생 하는 요소 무시 반환 합니다 후 모든 요소를 허용 하 고 _Delim 읽어야 합니다.

반환 값

스트림 (*이).

설명

최대 서식이 지정 되지 않은 입력된 함수 추출 _Count 요소 및이 제거 합니다.그러나 경우 _Count 인 numeric_limits <int>:: 최대, 같은 임의의 큰 수행 됩니다.추출 중지 초기 요소 또는 파일의 끝에 _Ch 는 traits_type::to_int_type(_Ch) 비교 동일 _Delim (추출할 것도).함수 반환 *이.

예제

// basic_istream_ignore.cpp
// compile with: /EHsc
#include <iostream>
int main( ) 
{
   using namespace std;
   char chararray[10];
   cout << "Type 'abcdef': ";
   cin.ignore( 5, 'c' );
   cin >> chararray;
   cout << chararray;
}
  abcdef
  abcdef
정의

요구 사항

헤더: <istream>

네임 스페이스: std

참고 항목

참조

basic_istream Class

iostream 프로그래밍

iostreams 규칙