3 out of 30 rated this helpful - Rate this topic

iostream Programming 

This section provides a general description of the iostream classes and then describes output streams, input streams, and input/output streams. The end of the section provides information about advanced iostream programming.

There is also a discussion on Thread Safety in the Standard C++ Library and the stdext namespace.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Using an ostringstream object to replace sprintf in legacy code.

The ostringstream class comes handy when you need to replace sprintf. For example, if you have

sprintf(str, "Bakery number: %d", number);

DrawText (hdc, str, -1, &drawRect, DT_SINGLELINE | DT_LEFT | DT_VCENTER);

you can use an ostringstream like this:

#include <sstream>

........

ostringstream s;

s << "Bakery Number: " << Number;

DrawText (hdc, s.str().data(), -1, &drawRect, DT_SINGLELINE | DT_LEFT | DT_VCENTER);