title: How are 3D arrays stored in C?
body: <p>I understand that arrays in C are allocated in row-major order. Therefore, for a 2 x 3 array:</p>
  
  <pre><code>0  1
  2  3
  4  5
  </code></pre>
  
  <p>Is stored in memory as</p>
  
  <pre><code>0 1 2 3 4 5
  </code></pre>
  
  <p>However, what if I have a 2 x 3 x 2 array:</p>
  
  <pre><code>0  1
  2  3
  4  5
  </code></pre>
  
  <p>and</p>
  
  <pre><code>6  7
  8  9
  10 11
  </code></pre>
  
  <p>How are these stored in memory? Is just consecutive like:</p>
  
  <pre><code>0 1 2 3 4 5 6 7 8 9 10 11
  </code></pre>
  
  <p>Or is it some other way? Or does it depend on something?</p>