delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/01/20/23:00:25

From: kblix AT idont DOT want DOT your DOT spam (Kim Robert Blix)
Newsgroups: comp.os.msdos.djgpp
Subject: Bug in djgpp c++ compilation?? (or am I just knocking my head against the wrong wall?)
Date: Tue, 20 Jan 1998 08:09:15 GMT
Organization: Tele2 Norway
Lines: 27
Message-ID: <34c45b5b.362910@news1.c2i.net>
NNTP-Posting-Host: 193.216.218.11
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Any idea why this wont work with djgpp? Its written word by word from
a C++ book, so I dont think its my fault :) .. (the operative word
there is think). I've had similar problems with more or less all C++
file rutines. Any help ?

--cut-code--
#include <fstream.h>
int main()
{
        ofstream OutFile;
        int MyNumber = 3;

        OutFile.open("testfil.dat",ios::binary);
        OutFile.write((char *)&MyNumber,sizeof(MyNumber));
        OutFile.close();

        return 0;
}
--end-code--

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Kim Robert Blix  ( kblix AT c2i DOT net )
  
 "How do you shoot the devil in the back?"
 "What if you miss?" -Verbal Kint
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019