This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]