Asri-unix.434
net.unix-wizards
utzoo!decvax!ucbvax!menlo70!sri-unix!gwyn@UTEXAS-11
Tue Jan 5 22:39:41 1982
Reply to: C arrays: some oddities
My understanding of the intent of the language agrees with the Ritchie
compiler's, except that in the case
type array[SIZE];
type array2[SIZE1][SIZE2];
I would have expected &array and &array2 to be undefined (although I
think the Ritchie compiler does the right thing if they are defined).
type array3[SIZEA][SIZEB][SIZEB];
array3 == &array3[0] == &array3[0][0] == &array3[0][0][0];
array3[i] == &array3[i][0] == &array3[i][0][0];
array3[i][j] == &array3[i][j][0];
is how I interpret "incomplete" array subscripting; I recommend writing
&array3[0][0][0] instead of
array3
to make the C code less subject to interpretation by the reader (you get
the same generated code in either case, but the address of an array
element is the more familiar concept to most programmers).
-------
-----------------------------------------------------------------
gopher://quux.org/ conversion by John Goerzen <
[email protected]>
of
http://communication.ucsd.edu/A-News/
This Usenet Oldnews Archive
article may be copied and distributed freely, provided:
1. There is no money collected for the text(s) of the articles.
2. The following notice remains appended to each copy:
The Usenet Oldnews Archive: Compilation Copyright (C) 1981, 1996
Bruce Jones, Henry Spencer, David Wiseman.