binary open mode

F

frm

i'm using djgpp with gcc 3.3.2 on windows 98.
i usually open a file in this way:
fstream f("file.txt", ios_base::binary);
but when i compile the code, gpp prints:
ios_base undeclared
i tried also with ios::binary, or declaring f as ifstream, but the
result is the same.
please help me!
 
V

Victor Bazarov

frm said:
i'm using djgpp with gcc 3.3.2 on windows 98.
i usually open a file in this way:
fstream f("file.txt", ios_base::binary);
but when i compile the code, gpp prints:
ios_base undeclared
i tried also with ios::binary, or declaring f as ifstream, but the
result is the same.

Did you include all the necessary headers? Post the minimal complete
code that exhibits the error, and not just one line like you did.
 
?

=?iso-8859-1?Q?Juli=E1n?= Albo

frm escribió:
i usually open a file in this way:
fstream f("file.txt", ios_base::binary);
but when i compile the code, gpp prints:
ios_base undeclared
i tried also with ios::binary, or declaring f as ifstream, but the
result is the same.

ios and ios_base are in the std namespace, you probably need to prefix
with std::

Regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,129
Latest member
FastBurnketo
Top