fork(1) download
  1. #include <stdio.h>
  2.  
  3. int sum[3][1];
  4. void calculate(int (*a)[4]);
  5. int main(void) {
  6. int p[3][4] = { {1,2,3,4},
  7. {5,6,7,8},
  8. {9,10,11,12} };
  9. calculate(p);
  10. for(int x=0;x<3;x++){
  11. printf("%d",*p[x]);
  12. }
  13. return 0;
  14. }
  15.  
  16. void calculate(int (*a)[4])
  17. {
  18. for(int i=0;i<3;i++){
  19. for(int j=0;j<4;j++){
  20. sum[i][1] += a[i][j];
  21. }
  22. }
  23. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
159