From f34b966f9a3aecfe44b93a86f4958ef6352c9c77 Mon Sep 17 00:00:00 2001 From: schneideral98915 Date: Mon, 17 Nov 2025 12:50:17 +0100 Subject: [PATCH] matrix.c --- Start_Windows/matrix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Start_Windows/matrix.c b/Start_Windows/matrix.c index 5390c55..b592704 100644 --- a/Start_Windows/matrix.c +++ b/Start_Windows/matrix.c @@ -114,9 +114,10 @@ Matrix add(const Matrix matrix1, const Matrix matrix2) return createMatrix(0, 0); } + for(unsigned int i = 0; i < resRows; ++i) { - for(unsigned int j = 0; i < resCols; ++j) + for(unsigned int j = 0; j < resCols; ++j) { unsigned int i1 = (matrix1.rows == 1) ? 0 : i; unsigned int j1 = (matrix1.cols == 1) ? 0 : j; @@ -124,6 +125,7 @@ Matrix add(const Matrix matrix1, const Matrix matrix2) unsigned int i2 = (matrix2.rows == 1) ? 0 : i; unsigned int j2 = (matrix2.cols == 1) ? 0 : j; + MatrixType val = getMatrixAt(matrix1, i1, j1) + getMatrixAt(matrix2, i2, j2); setMatrixAt(val, &result, i, j); }