I'm trying to learn a bit more about how I/O streams work in C++, and I'm really confused at when to use what.
What exactly is a streambuf
?
When do I use a streambuf
, as compared to a string
, an istream
, or a vector
? (I already know the last three, but not how streambuf
compares to them, if it does at all.)
With the help of streambuf
, we can work in an even lower level. It allows access to the underlying buffers.
Here are some good examples : Copy, load, redirect and tee using C++ streambufs and in reference to comparison, This might be helpful,
See this for more details : IOstream Library