delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/20/08:23:37

Date: Tue, 20 Apr 1999 12:28:17 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: vern <vern AT iocc DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: writing to a file
In-Reply-To: <371BA6B3.E5FF77BB@iocc.com>
Message-ID: <Pine.SUN.3.91.990420122751.841U-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 19 Apr 1999, vern wrote:

> I can open
> the file successfully, but I cannot write to it.  I am trying to write
> the following ot the file:  an array of BITMAPS (if u havent used
> allegro, a bitmap is a typedef structure), and an array of structures.
[snip]
>    save_file = fopen("demo.map", "w");

This last line is the problem: you need to open the file with "wb",
since this is binary data you are trying to write.

> Ive spent some time trying to figure this out myself, but no luck.

Too bad you didn't look in the FAQ first: this problem is explained
there in section 9.3.

- Raw text -


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