tgrekov-pipex
HIVE pipex May 2024
Loading...
Searching...
No Matches
arr_free.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* arr_free.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: tgrekov <tgrekov@student.hive.fi> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2024/04/22 07:52:00 by tgrekov #+# #+# */
9/* Updated: 2024/05/06 14:03:44 by tgrekov ### ########.fr */
10/* */
11/* ************************************************************************** */
12
20#include <stdlib.h>
21
29void **arr_free(void **arr)
30{
31 int i;
32
33 if (!arr)
34 return (0);
35 i = 0;
36 while (arr[i])
37 free(arr[i++]);
38 free(arr);
39 return (0);
40}
void ** arr_free(void **arr)
Free each element in a null-terminated array, and then the array itself.
Definition arr_free.c:29