10[25]==35? Really?

Henry Spencer henry at zoo.toronto.edu
Tue Feb 26 03:36:16 AEST 1991


In article <25694 at netcom.COM> avery at netcom.COM (Avery Colter) writes:
>With all this about the #define X1 -10, I find it interesting that
>indexing a constant yields the sum of the constant and the number inside
>the brackets.

It shouldn't.  The definition of a[b] is that it acts like *(a+b) [ignoring
issues of parentheses and operator precedence].  Note the "*" on the front.
-- 
"But this *is* the simplified version   | Henry Spencer @ U of Toronto Zoology
for the general public."     -S. Harris |  henry at zoo.toronto.edu  utzoo!henry



More information about the Comp.lang.c mailing list