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)
|
||||
{
|
||||
return m;
|
||||
printf("Error");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
m.data = calloc(rows * cols, sizeof(MatrixType));
|
||||
if (m.data == NULL)
|
||||
{
|
||||
m.rows = 0;
|
||||
m.cols = 0;
|
||||
return m;
|
||||
printf("Error");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
return m;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user