Date: Fri, 23 Sep 94 16:34:32 -0400 From: Yadin Y. Goldschmidt To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: bug (?) in djgpp Cc: yygold AT yadin DOT phyast DOT pitt DOT edu The following c++ program was taken from a book and compiles and executes fine on a unix station (NeXT). However with djgpp on a PC it compiles with no warning, but when executed gives a segmentation fault. Any clues? // an example of reading and writing binary buffers to/from a file # include # include # include # include main() { ofstream out("test"); if(!out) { cout << "cannot open output file. \n"; return 1; } double num=100.45; char str[]="This is a test"; out.write((char *) &num, sizeof(double)); out.write(str,strlen(str)); out.close(); return 0; }