streamsize
Denotes the size of the stream.
#ifdef _WIN64
typedef __int64 streamsize;
#else
typedef int streamsize;
#endif
설명
The type is a signed integer that describes an object that can store a count of the number of elements involved in various stream operations. Its representation has at least 16 bits. It is not necessarily large enough to represent an arbitrary byte position within a stream.
예제
After compiling and running the following program, look at the file test.txt to see the effect of setting streamsize.
// ios_streamsize.cpp
// compile with: /EHsc
#include <iostream>
#include <fstream>
int main( )
{
using namespace std;
char a[16] = "any such text";
ofstream x( "test.txt" );
streamsize y = 6;
x.write( a, y );
}
요구 사항
Header: <ios>
네임스페이스: std