delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/28/16:52:04

From: Ian Miller <itmiller AT dera DOT gov DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Trouble with a binary ofstream
Date: 28 Aug 1997 12:51:49 +0100
Organization: Defence Research Agency
Message-ID: <87zpq2zfsa.fsf@hasn.dra.hmg.gb>
References: <33FEF5B4 DOT BFC007BE AT pacificnet DOT net>
NNTP-Posting-Host: 146.80.115.106
Lines: 20
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

James Coram <jcoram AT pacificnet DOT net> writes:

> 
> I am having trouble using a binary ofstream with DJGPP. I get different
> results depending on how I compile my program...
> 
> /*test.cc*/
>  ...
> 
> int main() {
>  ofstream os("out", ios::binary);
>  ...

I have not tried it but I suggest you try ios::out|ios::binary
for the open mode argument.

Just an idea. I'm not guaranteeing it will work.
--
Ian Miller, Dorset, UK
DJGPP 2.01, Win95 DOS box (LFN undefined, FNCASE=y)

- Raw text -


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