Mail Archives: djgpp/2000/01/18/16:33:09
I run into the following problem:
using DJGPP 2.02-2.03 and GCC/GPP 2.81 or 2.95.1
on a plain i386/DOS 6.22 machine
I can not open fstream in BINARY mode,
e.g. I got zero size file from the sample program below.
If this is G++ problem could you forward this message to
GCC/G++ mailing list, please.
It is OK when I use FILE *fp; fp = open(somename, "wb");
though.
Leonid.
#include <iostream>
#include <fstream>
int main (int argc, char *argv[])
{
ofstream fpw (argv[1], ios::binary);
for (int i=0; i<256; i++) {
fpw.put( ((char)i) );
}
}
- Raw text -