-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_matrix_clear.c
executable file
·31 lines (28 loc) · 1.11 KB
/
ft_matrix_clear.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_matrix_clear.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: akharrou <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/04 15:17:03 by akharrou #+# #+# */
/* Updated: 2019/03/04 15:27:41 by akharrou ### ########.fr */
/* */
/* ************************************************************************** */
#include "../Includes/stdlib_42.h"
int ft_matrix_clear(void ***matrix)
{
int row;
if (matrix)
{
if (*matrix)
{
row = 0;
while ((*matrix)[row])
free((*matrix)[row++]);
}
(*matrix) = NULL;
return (0);
}
return (-1);
}