Aspects


vs


Home Page
About Us
Feedback

Ostream

In C++ std::ostream is the base class for output streams.

Ostringstream

Output stream class to operate on strings.



Others

Example

Ostream is more general subclasses support writing to different places ostringstream is a specific one writing to a string

from question  

C++: What is the difference between ostream and ostringstream?

In c++ you could associate the output stream with a null device too and test the number of charactes printed with std ostream tellp;however using ostringstream is a way better solution see the answers by devsolar or angew

from question  

Using sprintf with std::string in C++

Back to Home
Data comes from Stack Exchange with CC-BY-SA-4.0