This repository has been archived on 2024-12-16. You can view files and clone it, but cannot push or open issues or pull requests.
CodeBlocksPortable/WATCOM/samples/cplbexam/strstrea/ostrstre/construc.cpp

18 lines
524 B
C++

#include <strstrea.h>
void main( void ) {
char s[20];
ostrstream output; // initialized an ostrstream object
output << "Open Watcom C++ "; // write string into the object
istrstream input ( output.str() ); // return the pointer of the buffer
input >> s;
cout << "The first string in the ostrstream object is \""
<< s << "\"" << endl;
input >> s;
cout << "The second string in the ostrstream object is \""
<< s << "\"" << endl;
}