fork(1) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. typedef int Array_4D_Type[4][3][2][1];
  4. int main(void) {
  5. Array_4D_Type *arr = malloc(5 * sizeof(Array_4D_Type));
  6. // ^^^^^^^^^^^^^^^^ here, allocate a length-5 vector of 4d array type
  7. int *p = &arr[0][0][0][0][0];
  8. for (int i = 0 ; i < 120 ; i++){
  9. p[i] = i;
  10. }
  11. printf("arr_start = %d, end = %d\n", arr[0][0][0][0][0], arr[4][3][2][1][0]);
  12.  
  13. return 0;
  14. }
Success #stdin #stdout 0s 2300KB
stdin
Standard input is empty
stdout
arr_start = 0, end = 119