basic_streambuf::sgetc

스트림 내의 위치를 변경 하지 않고 현재 요소를 반환 합니다.

int_type sgetc( );

반환 값

현재 요소입니다.

설명

읽기 위치를 사용할 수 있으면, 멤버 함수 반환 traits_type::to_int_type(*gptr).그렇지 않으면 반환 언더플로.

예제

// basic_streambuf_sgetc.cpp
// compile with: /EHsc
#include <iostream>
#include <fstream>

int main( ) 
{
   using namespace std;
   ifstream myfile( "basic_streambuf_sgetc.txt", ios::in );

   char i = myfile.rdbuf( )->sgetc( );
   cout << i << endl;
   i = myfile.rdbuf( )->sgetc( );
   cout << i << endl;
}

입력: basic_streambuf_sgetc.txt

testing

59xe2ztd.collapse_all(ko-kr,VS.110).gifOutput

t
t

요구 사항

헤더: <streambuf>

네임 스페이스: std

참고 항목

참조

basic_streambuf Class

iostream 프로그래밍

iostreams 규칙