strstreambuf::pcount

제어 되는 시퀀스를 작성 하는 요소의 개수를 반환 합니다.

streamsize pcount( ) const;

반환 값

제어 되는 시퀀스에 기록 된 요소의 개수입니다.

설명

특히 경우 pptr 은 null 포인터입니다. 함수는 0을 반환 합니다.그렇지 않으면, 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

참고 항목

참조

strstreambuf Class

iostream 프로그래밍

iostreams 규칙