diff --git a/matrix.c b/matrix.c index 8fec4b7..79a87b3 100644 --- a/matrix.c +++ b/matrix.c @@ -11,9 +11,9 @@ Matrix createMatrix(unsigned int rows, unsigned int cols) Matrix matrix; matrix.rows = rows; matrix.cols = cols; - matrix.buffer = (float*) calloc(rows * cols, sizeof(float)); //belegt den speicherplatz mit calloc + matrix.buffer = (float*) calloc(rows * cols, sizeof(float)); //belegt den speicherplatz mit calloc -> mit 0 return matrix; - }else{ + }else{ //Bei einer "falschen" Matrix eine leere zurückgeben, ohne speicher zu belegen printf("Nullgroesse der Matrix!!!\n"); Matrix matrix; matrix.rows = 0; diff --git a/matrix.h b/matrix.h index 019617a..f299942 100644 --- a/matrix.h +++ b/matrix.h @@ -6,6 +6,7 @@ typedef float MatrixType; // TODO Matrixtyp definieren +// Done Matrix Struktur typedef struct { unsigned int rows;