programming-examples/c++/Others/An array-based output stream.cpp
2019-11-15 12:59:38 +01:00

16 lines
332 B
C++

An array-based output stream
#include <strstream>
#include <iostream>
using namespace std;
int main()
{
char str[80];
ostrstream outs(str, sizeof(str));
outs << "array-based I/O. ";
outs << 1024 << hex << " ";
outs.setf(ios::showbase);
outs << 100 << ' ' << 99.789 << ends;
cout << str;
return 0;
}