From 54ca7acca2f7e77450783ed577b9a0bf10f01cbe Mon Sep 17 00:00:00 2001 From: maxgrf Date: Thu, 20 Nov 2025 14:27:47 +0100 Subject: [PATCH] Kommentare angepasst --- matrix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/matrix.c b/matrix.c index 41f812d..0f183f3 100644 --- a/matrix.c +++ b/matrix.c @@ -34,15 +34,16 @@ void clearMatrix(Matrix *matrix) void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx) { - if (rowIdx < matrix.rows && colIdx < matrix.cols && matrix.buffer != NULL) - matrix.buffer[rowIdx * matrix.cols + colIdx] = value; //gibt xxxxxxxxxx + if (rowIdx < matrix.rows && colIdx < matrix.cols && matrix.buffer != NULL) //Prüft ob Zugriff möglich + matrix.buffer[rowIdx * matrix.cols + colIdx] = value; + //schreibt 2D element in 1D Liste: Element_Reihe*Matrix_Spalten + Element_Spalte } MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int colIdx) { if (rowIdx >= matrix.rows || colIdx >= matrix.cols || matrix.buffer == NULL) return 0; // Sicherheitscheck - return matrix.buffer[rowIdx * matrix.cols + colIdx]; //xxxxxxxxxxxx + return matrix.buffer[rowIdx * matrix.cols + colIdx]; } // TODO: Funktionen implementieren