This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: A simple question of fstream
- From: John Love-Jensen <eljay at adobe dot com>
- To: Ajay Bansal <Ajay_Bansal at infosys dot com>, <gcc-help at gcc dot gnu dot org>
- Date: Thu, 30 Jan 2003 06:48:32 -0600
- Subject: Re: A simple question of fstream
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;
}