This is the mail archive of the gcc@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]

fstream.h


I obtain access a text file in windows using the
include fstream.h. My =
question is. I use this include in gcc or other
include? I try use this =
include but can't compile the program.=20

Source of program:
#include <fstream.h>
{
        float pi=3D3.14;
        double d =3D 2.3456;
        ofstream myfile;
        const char* fname =3D "fileout.dat";
        myfile.open (fname);
        if (!myfile)
                cout << "File " << fname << " not
open";
        myfile << pi << endl << d;
        myfile.close();
}

some errors:
/usr/include/iostream.h:250: warning: data definition
has no type or =
storage class
/usr/include/iostream.h:252: parse error before `clog'
/usr/include/iostream.h:256: warning: data definition
has no type or =
storage class
/usr/include/iostream.h:258: parse error before `&'
/usr/include/iostream.h:259: parse error before `&'
/usr/include/iostream.h:260: parse error before `&'
/usr/include/iostream.h:261: parse error before `&'
/usr/include/iostream.h:265: parse error before `&'
/usr/include/iostream.h:267: parse error before `&'
/usr/include/iostream.h:269: parse error before `&'
In file included from ops.c:1:
/usr/include/fstream.h:38: parse error before `:'
/usr/include/fstream.h:40: warning: data definition
has no type or =
storage class
/usr/include/fstream.h:41: conflicting types for
`fstreambase'
/usr/include/fstream.h:40: previous declaration of
`fstreambase'
/usr/include/fstream.h:41: warning: data definition
has no type or =
storage class
/usr/include/fstream.h:42: parse error before `=3D'
/usr/include/fstream.h:42: warning: data definition
has no type or =
storage class
/usr/include/fstream.h:43: conflicting types for
`close'
/usr/include/streambuf.h:444: previous declaration of
`close'
/usr/include/fstream.h:45: parse error before `*'
/usr/include/fstream.h:45: redefinition of `rdbuf'

Anyone have ideia of how compile this? How i decide
this?




_______________________________________________________________________________________________
Yahoo! Empregos
O trabalho dos seus sonhos pode estar aqui. Cadastre-se hoje mesmo no Yahoo! Empregos e tenha acesso a milhares de vagas abertas!
http://br.empregos.yahoo.com/


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