Objects of the ostrstream class can be constructed and destructed.
public:~ostrstream()
This is supported on

The ostrstream destructor frees space allocated by the ostrstream constructor. The destructor also writes a null byte to the stream buffer to terminate the stream.
public:ostrstream(signed char* str, int size, int = ios::out)
This is supported on

This constructor specifies that the stream buffer that is attached to the ostrstream object consists of an array that starts at the position pointed to by str with a length of size bytes. If ios::ate or ios::app is set, str points to a null-terminated string and insertions begin at the null character. Otherwise, insertions begin at the position pointed to by str. You can use the ostream::seekp() function to reposition the put pointer.
This function is available for 32-bit applications. The second argument is an int value.
public:ostrstream(unsigned char* str, long size, int = ios::out)
This is supported on

This constructor specifies that the stream buffer that is attached to the ostrstream object consists of an array that starts at the position pointed to by str with a length of size bytes. If ios::ate or ios::app is set, str points to a null-terminated string and insertions begin at the null character. Otherwise, insertions begin at the position pointed to by str. You can use the ostream::seekp() function to reposition the put pointer.
This function is available for 64-bit applications. The second argument is a long value.
public:ostrstream(char* str, long size, int = ios::out)
This is supported on

This constructor specifies that the stream buffer that is attached to the ostrstream object consists of an array that starts at the position pointed to by str with a length of size bytes. If ios::ate or ios::app is set, str points to a null-terminated string and insertions begin at the null character. Otherwise, insertions begin at the position pointed to by str. You can use the ostream::seekp() function to reposition the put pointer.
This function is available for 64-bit applications. The second argument is a long value.
public:ostrstream(signed char* str, long size, int = ios::out)
This is supported on

This constructor specifies that the stream buffer that is attached to the ostrstream object consists of an array that starts at the position pointed to by str with a length of size bytes. If ios::ate or ios::app is set, str points to a null-terminated string and insertions begin at the null character. Otherwise, insertions begin at the position pointed to by str. You can use the ostream::seekp() function to reposition the put pointer.
This function is available for 64-bit applications. The second argument is a long value.
public:ostrstream(unsigned char* str, int size, int = ios::out)
This is supported on

This constructor specifies that the stream buffer that is attached to the ostrstream object consists of an array that starts at the position pointed to by str with a length of size bytes. If ios::ate or ios::app is set, str points to a null-terminated string and insertions begin at the null character. Otherwise, insertions begin at the position pointed to by str. You can use the ostream::seekp() function to reposition the put pointer.
This function is available for 32-bit applications. The second argument is an int value.
public:ostrstream(char* str, int size, int = ios::out)
This is supported on

This constructor specifies that the stream buffer that is attached to the ostrstream object consists of an array that starts at the position pointed to by str with a length of size bytes. If ios::ate or ios::app is set, str points to a null-terminated string and insertions begin at the null character. Otherwise, insertions begin at the position pointed to by str. You can use the ostream::seekp() function to reposition the put pointer.
This function is available for 32-bit applications. The second argument is an int value.
public:ostrstream()
This is supported on

This constructor specifies that space is allocated dynamically for the stream buffer that is attached to the ostrstream object.
Use these functions to work with the stream buffer.
Returns the number of bytes that have been stored in the stream buffer. pcount() is mainly useful when binary data has been stored and the stream buffer attached to the ostrstream object is not a null-terminated string. pcount() returns the total number of bytes, not just the number of bytes up to the first null character.
public:int pcount()
This is supported on

This function returns an int value for 32-bit applications. It is not available for 64-bit applications.
public:long pcount()
This is supported on

This function returns a long value for 64-bit applications. It is not available for 32-bit applications.
public:char* str()
This is supported on

Returns a pointer to the stream buffer attached to the ostrstream and calls freeze() with a nonzero value to prevent the stream buffer from being deleted. If the stream buffer was constructed with an explicit array, the value returned is a pointer to that array. If the stream buffer was constructed in dynamic mode, str points to the dynamically allocated area.
Until you call str(), deleting the dynamically allocated stream buffer is the responsibility of the ostrstream object. After str() has been called, the calling application has responsibility for the dynamically allocated stream buffer.