fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <stdint.h>
  4.  
  5. uint32_t (*makeit(unsigned long sz))[8] {
  6. uint32_t (*arr)[8] = malloc(8*sz*sizeof(int));
  7. int i, j;
  8. for (i = 0; i < sz; i++) {
  9. for (j = 0; j < 8; j++) {
  10. arr[i][j] = 10*i+j+11;
  11. }
  12. }
  13. return arr;
  14. }
  15.  
  16. void useit(unsigned long sz) {
  17. uint32_t (*arr)[8] = makeit(sz);
  18. for ( int i = 0; i < sz; ++i )
  19. {
  20. for ( int j = 0; j < 8; ++j )
  21. {
  22. printf("%d ", arr[i][j]);
  23. }
  24. printf("\n");
  25. }
  26. }
  27.  
  28. int main()
  29. {
  30. useit(10);
  31. }
  32.  
  33.  
Success #stdin #stdout 0s 2244KB
stdin
Standard input is empty
stdout
11 12 13 14 15 16 17 18 
21 22 23 24 25 26 27 28 
31 32 33 34 35 36 37 38 
41 42 43 44 45 46 47 48 
51 52 53 54 55 56 57 58 
61 62 63 64 65 66 67 68 
71 72 73 74 75 76 77 78 
81 82 83 84 85 86 87 88 
91 92 93 94 95 96 97 98 
101 102 103 104 105 106 107 108