다음을 통해 공유


strstreambuf::pcount

Returns a count of the number of elements written to the controlled sequence.

streamsize pcount( ) const;

반환 값

A count of the number of elements written to the controlled sequence.

설명

Specifically, if pptr is a null pointer, the function returns zero. Otherwise, it returns 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

요구 사항

Header: <strstream>

네임스페이스: std

참고 항목

참조

strstreambuf 클래스

iostream 프로그래밍

iostreams 규칙