strstream();
strstream( char* pch, int nLength, int nMode );
pch
A character array that is large enough to accommodate future output stream activity.
nLength
The size (in characters) of pch. If 0, then pch is assumed to point to a null-terminated array; if less than 0, then the array is assumed to have infinite length.
nMode
The stream creation mode. Must be one of the following enumerators as defined in class ios:
Value | Meaning |
ios::in | Retrieval begins at the beginning of the array. |
ios::out | By default, storing begins at pch. |
ios::ate | The pch parameter is assumed to be a null-terminated array; storing begins at the NULL character. |
ios::app | Same as ios::ate. |
The use of the ios::in and ios::out flags is optional for this class; both input and output are implied.
The first constructor makes an strstream object that uses an internal, dynamic buffer that is initially empty.
The second constructor makes an strstream object out of the first nLength characters of the psc buffer. The stream will not accept characters once the length reaches nLength.