fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a[2][2][3] =
  5. {
  6. { { 7,8,9},{ 3,4,5} },{ { 6,7,8 },{ 9,10,11 } }
  7. };
  8.  
  9. int *a_ptr = a[0][0];
  10.  
  11.  
  12. for (int i = 0; i < 12; i++) {
  13. printf("%d=%d\n",i, *(a + i) );
  14. }
  15.  
  16. printf("________________\n");
  17.  
  18. for (int i = 0; i < 12; i++) {
  19. printf("%d=%d\n",i, *(a_ptr + i) );
  20. }
  21. }
  22.  
Success #stdin #stdout 0s 4540KB
stdin
Standard input is empty
stdout
0=1263831504
1=1263831528
2=1263831552
3=1263831576
4=1263831600
5=1263831624
6=1263831648
7=1263831672
8=1263831696
9=1263831720
10=1263831744
11=1263831768
________________
0=7
1=8
2=9
3=3
4=4
5=5
6=6
7=7
8=8
9=9
10=10
11=11