Section

std::strstream

The class strstream implements input and output operations on array-backed streams. It essentially wraps a raw array I/O device implementation (std::strstreambuf) into the higher-level interface of std::basic_iostream.

# Declarations

class strstream : public std::iostream

(deprecated in C++98) (removed in C++26)

# Notes

After any call to str(), a call to freeze(false) is required to allow the destructor to deallocate the buffer as necessary.

Before any call to str() that uses the result as a C-string, the buffer must be null-terminated, typically with std::ends.

strstream has been deprecated since C++98 and removed since C++26. std::stringstream, std::spanstream(since C++23), and boost::iostreams::array are the recommended replacements.