Mail Archives: djgpp/1998/07/09/12:46:55
From: | Endlisnis <s257m AT unb DOT ca>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: Writing to a file.
|
Date: | Thu, 9 Jul 1998 12:39:52 -0300
|
Organization: | University of New Brunswick
|
Lines: | 19
|
Message-ID: | <Pine.SOL.3.96.980709122419.2993D-100000@sol.sun.csd.unb.ca>
|
References: | <01bdaac9$dbe7ec80$bf0562cb AT default> <2FFF738A DOT 74A4 AT linetap DOT com>
|
NNTP-Posting-Host: | sol-alt1.unb.ca
|
Mime-Version: | 1.0
|
In-Reply-To: | <2FFF738A.74A4@linetap.com>
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
On Thu, 9 Jul 1998, nebo wrote:
->> Hello,
->> I am writing a map editor for a game I am making A rts game with tiles.
->> I have a big array of tiles.
->> eg. unsigned char map[100][100]
If you are working in C++ you can use fstreams:
#include<fstream.h>
fstream File("filename.ext", ios::out|ios::binary);
File.write(map,sizeof(map));
//to write
fstream File("filename.ext", ios::out|ios::binary);
File.read(map,sizeof(map));
//to read
Endlisnis
[I have a pyramid of wingyness]
- Raw text -