fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #define ROWS 4
  5. #define COLS 3
  6.  
  7. int main(void)
  8. {
  9. int p[ROWS][COLS];
  10.  
  11. p[0][0] = 1;
  12. p[0][1] = 2;
  13. p[0][2] = 3;
  14. p[1][0] = 4;
  15. p[1][1] = 5;
  16. p[1][2] = 6;
  17. p[2][0] = 7;
  18. p[2][1] = 8;
  19. p[2][2] = 9;
  20. p[3][0] = 10;
  21. p[3][1] = 11;
  22. p[3][2] = 12;
  23.  
  24. for (size_t i = 0; i < ROWS; ++i) {
  25. for (size_t j = 0; j < COLS; ++j) {
  26. int x = *(*(p + i) + j);
  27. printf("%d\n", x);
  28. }
  29. }
  30.  
  31. return EXIT_SUCCESS;
  32. }
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
1
2
3
4
5
6
7
8
9
10
11
12