An array-based output stream : Array Based IO « File « C++






An array-based output stream

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;
}

           
       








Related examples in the same category

1.A dynamic output arrayA dynamic output array
2.Using Binary I/O with Array-Based StreamsUsing Binary I/O with Array-Based Streams