Note that conditional compilation may be necessary to accommodate both the user threads and the kernel threads interfaces, as in the above example. An alternative might be to compose a buffer with an ostrstream and output with one write. The following example could be used with the cfront compatiblelibstream:
ostrstream ostr;
ostr << “something” /*...*/ ;
ostr << “ or another” /*...*/ << endl; cout.write(ostr.str(), ostr.pcount());
Note that the above example works with the new library, though with the deprecated ostrstream.
Or something similar can be done with the Rogue Wave Standard C++ Library 2.2.1 (libstd_v2) with standard ostringstream, as in the following example:
ostringstream ostr;
ostr << “something” /*...*/ ;
ostr << “ or another” /*...*/ << endl; cout.write(ostr.str().c_str(), ostr.str().length());
Note that cout.flush may be needed if sharing the file with stdio.
Required
To use the
Rogue Wave Standard C++ Library 2.2.1
For both
•
•
•
•
Rogue Wave Standard C++ Library 1.2.1 and Tools.h++ 7.0.6
For both
•
•
•
•
•
•
•
•
NOTE: If you do not specify these options as described in both cases, a runtime error will be generated or
164 Exception Handling