create matrix update wip

This commit is contained in:
Niklas Wolf 2025-11-10 15:33:39 +01:00
parent f0bc0ce06a
commit 3a72794684

View File

@ -13,15 +13,15 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
if(rows == 0 || cols == 0) if(rows == 0 || cols == 0)
{ {
return m; printf("Error");
exit(EXIT_FAILURE);
} }
m.data = calloc(rows * cols, sizeof(MatrixType)); m.data = calloc(rows * cols, sizeof(MatrixType));
if (m.data == NULL) if (m.data == NULL)
{ {
m.rows = 0; printf("Error");
m.cols = 0; exit(EXIT_FAILURE);
return m;
} }
return m; return m;