#include #include #include 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; } const int a[] = {10, 20, 30}; const size_t n = sizeof a / sizeof a[0]; for (const int *p = a; p < a + n; ++p) { //if (operator<<(ofs.operator<<(*p), "\n").operator!()) { if (!(ofs << *p << "\n")) { return EXIT_FAILURE; } } return EXIT_SUCCESS; }