strstreambuf::pcount

傳回元素數目的計數會受控制序列寫入的。

streamsize pcount( ) const;

傳回值

項目數目的計數會控制序列寫入的。

備註

更明確地說, pptr ,如果為null指標,則函式會傳回零。否則,會傳回 pptrpbase

範例

// strstreambuf_pcount.cpp
// compile with: /EHsc
#include <iostream>
#include <strstream>
using namespace std;

int main( )
{
   strstream x;
   x << "test1";
   cout << x.rdbuf( )->pcount( ) << endl;
   x << "test2";
   cout << x.rdbuf( )->pcount( ) << endl;
}

Output

5
10

需求

標題: <strstream>

命名空間: std

請參閱

參考

strstreambuf Class

iostream 程式設計

iostreams 慣例