delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/25/17:07:35

Message-Id: <m0xPDN7-0007quC@fwd01.btx.dtag.de>
Date: Sat, 25 Oct 1997 23:03:49 +0200
To: jamie DOT love AT clear DOT net DOT nz, djgpp AT delorie DOT com
References: <199710250713 DOT UAA05511 AT fep1-orange DOT clear DOT net DOT nz>
Subject: Re: arrays of pointers
MIME-Version: 1.0
From: Georg DOT Kolling AT t-online DOT de (Georg Kolling)

Jamie Love schrieb:
> Hi, my mind is blank to the way to do the following.
>
> What i want is an array of five DATAFILE pointers (of Allegro type)
>
> At the moment i have DATAFILE *tiledata;
>
> and i want to do it so that i can access one of five datafiles in a quick
> array something like:
>
> DATAFILE *tiledata[5];
>
> I know this is wrong as it doesn't seem to work.

Sorry, but this isn't wrong at all...
This gives you an array of five not initialized pointers to DATAFILE structures
>
> also, how to i access the data stored in the data array when i do use the
> array of pointers
>
> is it like:
>
> tiledata[arraypointernum][datanum].dat;
>
> or what?

Exactly that should work... remenber to use
tiledata[0] = load_datafile("dat1.dat");
tiledata[1] = load_datafile("dat2.dat");
...

- Raw text -


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