返回元素数的计数将该控件序列写入的。
streamsize pcount( ) const;
返回值
元素数的计数对控件序列写入的。
备注
具体而言,因此,如果 pptr 是null指针,该函数返回零。否则,它将返回 pptr – pbase。
示例
// 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