A simple question of fstream

John Love-Jensen eljay@adobe.com
Thu Jan 30 12:53:00 GMT 2003


Hi Ajay,

I modified your example (see below), and it works for me (GCC 3.1 on OS X).

Sincerely,
--Eljay

#include <fstream>
#include <iostream>
#include <cstdlib>
#include <cerrno>
using namespace std;

int main()
{
    fstream iostrm;

    iostrm.open("new1.txt", ios_base::out | ios_base::in);

    cout << errno;
    iostrm.write("gagan", 5);

    iostrm.close();

    return 1;
}



More information about the Gcc-help mailing list