home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progc
/
c_all592.arj
/
TI729.ASC
< prev
next >
Wrap
Text File
|
1992-02-25
|
973b
|
67 lines
PRODUCT : Borland C++ NUMBER : 729
VERSION : 2.0
OS : DOS
DATE : February 25, 1992 PAGE : 1/1
TITLE : How to Use strstream
/*********************************************************
Example code for using strstream
*********************************************************/
#include <stdio.h> // the old C i/o stuff
#include <iostream.h> // C++ streams
#include <strstream.h>
char line[100]; // a buffer for lines of input
void main(void)
{
ostrstream mystream(line, 100); // associate line[] with a
stream
mystream << "testing"; // insertion to mystream
printf("%s\n", line); // output using old C style
cout << line; // output using C++ style
}