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: "Ajay Bansal" <Ajay_Bansal at infosys dot com>
- To: "John Love-Jensen" <eljay at adobe dot com>,<gcc-help at gcc dot gnu dot org>
- Date: Thu, 30 Jan 2003 18:33:56 +0530
- Subject: RE: A simple question of fstream
Still doesn't work with gcc 3.2.1, RH73
-----Original Message-----
From: John Love-Jensen [mailto:eljay@adobe.com]
Sent: Thursday, January 30, 2003 6:19 PM
To: Ajay Bansal; gcc-help@gcc.gnu.org
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;
}