www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/24/10:16:35

From: Andy Maddison <maddison AT coventry DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Help please - c++ file i/o
Date: Mon, 24 Nov 1997 13:12:20 +0000
Organization: Coventry University
Message-ID: <Pine.OSF.3.91.971124130801.18197B-100000@leofric>
NNTP-Posting-Host: leofric.coventry.ac.uk
Mime-Version: 1.0
Lines: 26
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

If you can help me, please do cos' I'm a bit stuck!

In Borland c++ the following works fine:

unsigned char palette[768];  

void main()
{
        fstream palFile;
        palFile.open("pal.dat",ios::binary);
        palFile.seekg(0);
        palFile.read(palette,768);
        palFile.close();
 
        code to manipulate palette, etc.  
}

but, using djgpp the array(palette) is just filled with zeros. 
What is going on? Is there something extra that has to be done when using 
djgpp?  I don't want to have to change to using c style i/o.  

Thanks,
        Andy      



- Raw text -


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