Definition of Array:
Contiguous area of memory consisting of equal-size elements indexed by contiguous integers.
What's Special About Arrays?
Constant-time access
array_addr + elem_size * (i - first_index)
How to get the address of multi-dimensional arrays?
image.pngRow-major,row keep unchanged,and column add.In column-major ordering, the first index changes most rapidly.
image.png
网友评论