Mail Archives: djgpp/1998/08/13/03:44:02
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 -