Date: Tue, 20 Apr 1999 12:28:17 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: vern cc: djgpp AT delorie DOT com Subject: Re: writing to a file In-Reply-To: <371BA6B3.E5FF77BB@iocc.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.