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