
5 Oct
2005
5 Oct
'05
7:15 a.m.
In C, p[n] is defined as *(p+n) (see [1] 6.5.2.1), with addition of pointers and integers defined as advancing the pointer by n array elements (6.5.6). So
(p = &p[5]) === (p = &*(p+5)) === (p = p+5) === (p += 5)
whatever the value of sizeof(*p).
[1] ISO/IEC 9899:1999 http://www.nirvani.net/docs/ansi_c.pdf, but this part was there from the beginning.
You learn something new every day :) Neil