delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/13/03:44:02

Date: Thu, 13 Aug 1998 10:44:00 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Cephaler <cephaler AT hotmail DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: pointers and errors make cephaler go crazy
In-Reply-To: <01bdc624$058eaa40$4ac3b8cd@scully>
Message-ID: <Pine.SUN.3.91.980813104342.2812E-100000@is>
MIME-Version: 1.0

On 12 Aug 1998, Cephaler wrote:

> I could've sworn I put the typedef in there... Well, it was:
> 
> typedef struct { unsigned char tile;unsigned char tag /*bitmask*/}

This is not enough.  You didn't say how the tiles[] array is declared,
for starters.

> > In contrast, an address of a variable is usually a large number (put 
> > simplistically, it is the number of the byte where that variable is 
> > stored), and could be anything.  In particular, it can be much more than 
> > N-1, which is the largest allowed index into an array.
> > 
> 
> So... If I read you correctly, there is absolutely no use for integers as
> pointers, except to pass an address? How do you retrieve the value of that
> int?! 

Sorry, I don't understand the question.  It seems to be totally
unrelated to what I tried (and obviously failed) to explain in the
part that you cite.

By the way of an example, what I was trying to explain was that this
code is right:

	char c = buf[i];

while this one is NOT:

        char c = buf[&i];

(Both examples assume that i is declared an int and assigned a
reasonable value.)

- Raw text -


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