File tree Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change 3452
3452
The expression
3453
3453
\tcode {x3d[i]}
3454
3454
is equivalent to
3455
- \tcode {*(x3d + i)};
3456
- in that expression,
3457
- \tcode {x3d}
3458
- is subject to the array-to-pointer conversion\iref {conv.array }
3459
- and is first converted to
3460
- a pointer to a 2-dimensional
3461
- array with rank
3462
- $ 5 \times 7 $
3463
- that points to the first element of \tcode {x3d}.
3464
- Then \tcode {i} is added,
3465
- which on typical implementations involves multiplying
3455
+ \tcode {*(x3d + i)},
3456
+ and is an lvalue denoting
3457
+ the $ \tcode {i}^\text {th}$ array element of
3458
+ \tcode {x3d},
3459
+ which is an array with rank $ 5 \times 7 $ .
3460
+ On typical implementations,
3461
+ computing the address of this two-dimensional array
3462
+ involves multiplying
3466
3463
\tcode {i} by the
3467
- length of the object to which the pointer points ,
3464
+ length of the array in bytes ,
3468
3465
which is \tcode {sizeof(int)}$ \times 5 \times 7 $ .
3469
- The result of the addition and indirection is
3470
- an lvalue denoting
3471
- the $ \tcode {i}^\text {th}$ array element of
3472
- \tcode {x3d}
3473
- (an array of five arrays of seven integers).
3474
3466
If there is another subscript,
3475
3467
the same argument applies again, so
3476
3468
\tcode {x3d[i][j]} is
You can’t perform that action at this time.
0 commit comments