In article <44***********************@newsread4.arcor-online.net>,
Heinz Ozwirk <ho**********@arcor.de> wrote:
On most machines I would expect (int) p to be less than (int)(p + 1), at
least if int is large enough to hold a pointer. But I don't remember that
the standard does require it.
I thought I'd posted a proof of this recently, but I cannot find
the appropriate posting now.
- C requires that addresses within structures are increasing
- one could union an array[10] together with a structure that
was two array[5]
- the second array within the struct must an increased address
relative to the first, due to the first point
- the address of the union would be common base -- which would
be the address of the structure and the address of the array[10]
- thus the address of the array[10] must be the address of the
first array[5] of the struct
- I cannot think of any logical way that after that the address of
the array[10] at index 5 would not be the same as the address
of index 0 of the second array[5]
- So since that second array[5] has an increased address relative
to the first, then the address of the array[10] at index 5 must
be increased in memory relative to that array at index 0, so
arrays must increase in memory
--
All is vanity. -- Ecclesiastes