delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/13/17:45:16

From: "Vermin" <ratspl AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <39940CD1 DOT 5691 DOT 11C46C5 AT localhost>
Subject: ...
Lines: 26
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
Message-ID: <yBEl5.2112$By6.30353@news1.online.no>
Date: Sun, 13 Aug 2000 23:47:26 +0200
NNTP-Posting-Host: 130.67.76.47
X-Complaints-To: news-abuse AT online DOT no
X-Trace: news1.online.no 966202846 130.67.76.47 (Sun, 13 Aug 2000 23:40:46 MET DST)
NNTP-Posting-Date: Sun, 13 Aug 2000 23:40:46 MET DST
Organization: Telenor Online Public Access
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

but how should I use the array in the procedure??
Let's say that I wanted to fill it with a byte stream from a file, how would
I then use it??

something like:

void readStream(char fileName[], unsigned char **memPos){
  ..open file, get length of byte stream etc..
  *memPos = new (unsigned char)[streamLength];
  for (int i = 0; i <= streamLength; i++){
    // I know that I should use only one read for it all, but this is just
an example...
    fread(memPos[i], 1, 1, inFile);
  }
  ...
}

int main(){
  ...
  readStream("splat.dat", &splatData);
  ...
}

Hope you can help!?!


- Raw text -


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