Added ClearMatrix Function And Added Return Value to CreateMatrix

This commit is contained in:
Tobias Grampp 2025-11-12 12:27:15 +01:00
parent 44b77815b3
commit 7acece0571

View File

@ -17,11 +17,13 @@ Matrix createMatrix(unsigned int rows, unsigned int cols)
newMatrix.rows = rows;
newMatrix.cols = cols;
newMatrix.buffer = calloc(rows*cols, sizeof(MatrixType))
return newMatrix;
}
void clearMatrix(Matrix *matrix)
{
free(*matrix.buffer);
*matrix.buffer = NULL;
}
void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned int colIdx)