Date: Thu, 13 Aug 1998 10:44:00 +0300 (IDT) From: Eli Zaretskii To: Cephaler cc: djgpp AT delorie DOT com Subject: Re: pointers and errors make cephaler go crazy In-Reply-To: <01bdc624$058eaa40$4ac3b8cd@scully> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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.)