Hi All
what is the difference between std:

stringstream and ostream ?
example :
int reel = 10 ;
std:

stringstream output;
std:

stream out;
output << "ReelStripBG" << reel;
out<<reel;
Thanks
Pallav Singh
Hi Pallav
The difference is almost obvious. The ostream is the standard library
class
for (Standard) output device stream. An ostream object like cout is
connected
to output device. On the other hand, Using ostrstream class, we can
connect
the output stream to string object rather than standard output. The
ostringstream
object connects output stream to a string.
int reel = 10 ;
std:

stringstream output;
std:

stream out; // error: no default ctor
output << "ReelStripBG"; // put to "ReelStripBG" to a string
cout << reel; // put to "10" to output stream
out<<reel; // error
cout << '\n' << putput.str() << '\n'; // put to "ReelStripBG" to
a output
Regards,
-- Saeed Amrollahi