create matrix update wip
This commit is contained in:
parent
f0bc0ce06a
commit
3a72794684
8
matrix.c
8
matrix.c
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user