Mail Archives: djgpp/1997/11/26/13:34:44
From: | Andy Maddison <maddison AT coventry DOT ac DOT uk>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Please Help! - file i/o
|
Date: | Wed, 26 Nov 1997 16:26:34 +0000
|
Organization: | Coventry University
|
Lines: | 26
|
Message-ID: | <Pine.OSF.3.91.971126162141.9073A-100000@leofric>
|
NNTP-Posting-Host: | leofric.coventry.ac.uk
|
Mime-Version: | 1.0
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Can anyone help me?
Program Fragment:
unsigned char palette[768];
fstream inFile;
inFile.open("pal.dat",ios::binary);
inFile.seekg(0); //not essential
inFile.read(palette,768);
inFile.close();
This works fine using Borland C++, but under DJGPP the array (palette) is
always filled with zeros (NULLs?).
What is happening? Why doesn't it work?
I like using C++ and I don't want to have to switch to C style file i/o.
Please help if you can cos' I'm stuck :(
Thanks
Andy
- Raw text -