Arrays

suggest change

An array type has no padding in between its elements. Therefore, an array with element type T is just a sequence of T objects laid out in memory, in order.

A multidimensional array is an array of arrays, and the above applies recursively. For example, if we have the declaration

int a[5][3];

then a is an array of 5 arrays of 3 ints. Therefore, a[0], which consists of the three elements a[0][0], a[0][1], a[0][2], is laid out in memory before a[1], which consists of a[1][0], a[1][1], and a[1][2]. This is called row major order.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Layout of object types:
* Arrays

Table Of Contents
8 Arrays
11 Loops
39 Streams
51 Unions
56 Lambdas
60 SFINAE
62 RAII
67 Sorting
84 RTTI
87 Scopes
104 Profiling
107 Recursion
117 Iteration
125 Alignment
131 Layout of object types
134 Semaphore
136 Debugging
139 Mutexes
142 decltype