fork(5) download
  1. #include <stdio.h>
  2.  
  3. int main () {
  4. int ***array = (int ***) malloc(3*sizeof(int**));
  5. int i, j;
  6.  
  7. for (i = 0; i < 3; i++) {
  8. array[i] = (int **)malloc(3*sizeof(int*));
  9. for (j = 0; j < 3; j++) {
  10. array[i][j] = (int *)malloc(3*sizeof(int));
  11. }
  12. }
  13.  
  14. array[1][2][1] = 10;
  15. printf("%d\n", array[1][2][1]);
  16. return 0;
  17. }
Success #stdin #stdout 0s 2300KB
stdin
Standard input is empty
stdout
10