Xref: news2.mv.net comp.os.msdos.djgpp:7619 From: James <100327 DOT 3421 AT CompuServe DOT COM> Newsgroups: comp.os.msdos.djgpp Subject: Writing to file problem(djgpp) Date: 18 Aug 1996 21:20:34 GMT Organization: CompuServe, Inc. (1-800-689-0736) Lines: 25 Message-ID: <4v81f2$4nr$1@mhadg.production.compuserve.com> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Can anybody help me with this problem please. When I try to run this program I get the general protection fault below, and the file is not written. I use djgpp with the command switch: gcc -v file5.cc -lgpp -lm coff2exe -s d:\gnu\bin\go32.exe a.out #include void main() { char employee; ofstream employ_record("a:\\file5.dat", ios::binary); if(employ_record) { cin >> employee; employ_record.write((int *) &employee, sizeof(employee) ); }} General Protection Fault at eip=b48 eax=000000a0 ebx=0005a004 ecx=0005d004 edx=00000000 esi=00000000 edi=00000000 ebp=00051c18 esp=00051c00 cs=af ds=a7 es=a7 fs=a7 gs=bf ss=b7 cr2=00001fec Call frame traceback EIPs: 0x00000b48 0x00004411 (Any help appreciated)