共用方式為


basic_streambuf::snextc

讀取目前的項目並傳回下列項目。

int_type snextc( );

傳回值

在資料流的下一個項目。

備註

成員函式呼叫(Function Call), sbumpc ,如果該函式傳回 traits_type::eof,傳回 traits_type::eof。 否則,會傳回 sgetc

範例

// basic_streambuf_snextc.cpp
// compile with: /EHsc
#include <iostream>
int main( ) 
{
   using namespace std;
   int i = 0;
   i = cin.rdbuf( )->snextc( );
   // cout << ( int )char_traits<char>::eof << endl;
   cout << i << endl;
}
  aa

FakePre-d027245cadd346feb7ce0bed76dd83e2-ab78df0af53246dabad4b00e5e9c3010

需求

標題: <streambuf>

命名空間: std

請參閱

參考

basic_streambuf Class

iostream 程式設計

iostreams 慣例