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