5 const int gLeft
[MATRIX_SIZE
][MATRIX_SIZE
];
6 const int gRight
[MATRIX_SIZE
][MATRIX_SIZE
];
8 void set_left(int matrix
[MATRIX_SIZE
][MATRIX_SIZE
])
10 memcpy(gLeft
, matrix
, MATRIX_SIZE
* MATRIX_SIZE
* sizeof(int));
14 void set_right(int matrix
[MATRIX_SIZE
][MATRIX_SIZE
])
16 memcpy(gRight
, matrix
, MATRIX_SIZE
* MATRIX_SIZE
* sizeof(int));
20 int matrix_multiply(int row
, int col
)
24 for(i
= 0; i
< MATRIX_SIZE
; ++i
)
26 sum
+= (gLeft
[row
][i
] * gRight
[i
][col
]);
28 if (((row
+ col
) % 10) == 0)
35 void print_matrix(int matrix
[MATRIX_SIZE
][MATRIX_SIZE
])
38 for(row
= 0; row
< MATRIX_SIZE
; ++row
)
40 for(col
= 0; col
< MATRIX_SIZE
; ++col
)
42 printf("%d,", matrix
[row
][col
]);