From 26d2d832c2a4f74ce0a444c88b1c3623c9933c99 Mon Sep 17 00:00:00 2001 From: glockeel104125 Date: Thu, 5 Nov 2026 11:16:59 +0100 Subject: [PATCH] Nach Termin --- Startcode/matrix.c | 4 +++- Startcode/matrix.h | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Startcode/matrix.c b/Startcode/matrix.c index ad00628..e8f5b66 100644 --- a/Startcode/matrix.c +++ b/Startcode/matrix.c @@ -6,7 +6,9 @@ Matrix createMatrix(unsigned int rows, unsigned int cols) { - + Matrix m; + m.rows = rows; + m.cols = cols; } void clearMatrix(Matrix *matrix) diff --git a/Startcode/matrix.h b/Startcode/matrix.h index cc640d1..ed4e68e 100644 --- a/Startcode/matrix.h +++ b/Startcode/matrix.h @@ -8,6 +8,25 @@ typedef float MatrixType; // TODO Matrixtyp definieren + + +//Aufgaben: +// 1) Eine Matrix ist definiert durch die Anzahl Zeilen und Spalten sowie einem Speicher- +// bereich mit den eigentlichen Werten. Implementieren Sie an geeigneter Stelle (welche +// ist das?) eine C-Struktur mit dem Namen Matrix, welche eine Matrix auf diese Art +// beschreibt. +typedef struct +{ + unsigned int rows; + unsigned int cols; + int *Memory; + //int Memory[rows][cols]; + +} Matrix; + + + + Matrix createMatrix(unsigned int rows, unsigned int cols); void clearMatrix(Matrix *matrix); void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx);