#include #include #include "ostream_iterator_int.h" using namespace std; int main(int argc, char **argv) { ofstream ofs("outfile"); if (!ofs) { cerr << argv[0] << ": couldn't open outfile\n"; return EXIT_FAILURE; } ostream_iterator_int it(ofs); const int a[] = {10, 20, 30}; const size_t n = sizeof a / sizeof a[0]; for (const int *p = a; p < a + n; ++p, ++it) { *it = *p; //it.operator*().operator=(*p); } return EXIT_SUCCESS; }