www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/24/21:32:41

X-ROUTED: Wed, 24 Feb 1999 21:33:46 -0500
X-TCP-IDENTITY: Ultima
Message-ID: <36D4B5AB.E2B176F9@game-master.com>
Date: Wed, 24 Feb 1999 21:30:05 -0500
From: Kevin Lang/Ultima <ultima AT game-master DOT com>
Organization: StormTech SoftWare
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Help
References: <36D162CB DOT E5B730A6 AT game-master DOT com> <36D2009E DOT E256EFBD AT cartsys DOT com> <36D46320 DOT 114420E4 AT game-master DOT com> <36D49611 DOT BF29AF33 AT cartsys DOT com>
Reply-To: djgpp AT delorie DOT com

This is a multi-part message in MIME format.
--------------31841F27F664CF60087A9846
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit



Nate Eldredge wrote:

> Kevin Lang/Ultima wrote:
> >
> > Nate Eldredge wrote:
> >
> > > iso_map->tile_map[((iy<<(iso_map->ysize))+ix)].attributes
> > >
> > > Actually, it's quite simple.  You can see that TILE.attributes is indeed
> > > an `int', so the compiler is quite justified.
> > >
> > > I assume what you want to do is read the contents of the `attributes'
> > > member from the packfile.  `pack_fread' wants its first arg to be a
> > > pointer to the buffer into which to read.  Therefore, all you need to do
> > > is take the address of this horrible expression (with the `&' operator)
> > > and pass that.
> >
> > Yes I sortof figured this out a little while after :-)But  I don't get why I should use the .
> > operator instead of ->
> >
> > You are supposed to use -> when you are using a pointer to a struct right?
> > But tile_map is also a pointer to a struct, so how come the compiler wants me to put a . instead
> > of ->
>
> `tile_map' is a pointer, correct.  However, `tile_map[nnn]' is not; it
> is one of the elements of `tile_map', which is an array.  Each of these
> elements *is* a struct and not a pointer.
>
> It may help to know that `p[x]' is equivalent to `*(p+x)'.

Ah I understand now :-)

Thanks for the information!

> --
>
> Nate Eldredge
> nate AT cartsys DOT com



--
                                 -=šUltimaš=-
WWW: http://www.game-master.com/ultima/
EMAIL: mailto:ultimaATgame-masterDOTcom (anti-spam)
ICQ: 12919201

Member and founder of StormTech SoftWare, visit our page today!


--------------31841F27F664CF60087A9846
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Kevin Lang
Content-Disposition: attachment; filename="vcard.vcf"

begin:          vcard
fn:             Kevin Lang
n:              Lang;Kevin
org:            StormTech SoftWare
adr:            ;;;;Quebec;;Canada
email;internet: ultima AT game-master DOT com
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard


--------------31841F27F664CF60087A9846--



- Raw text -


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