diff --git a/src/tab/tab.h b/src/tab/tab.h index 88de5d7..53e6e22 100644 --- a/src/tab/tab.h +++ b/src/tab/tab.h @@ -1,5 +1,7 @@ #pragma once +#include #include size_t tablen(const void** tab); +void tab_free(void** tab); diff --git a/src/tab/tab_free.c b/src/tab/tab_free.c new file mode 100644 index 0000000..516befb --- /dev/null +++ b/src/tab/tab_free.c @@ -0,0 +1,8 @@ +#include "tab.h" + +void tab_free(void** tab) +{ + for (size_t i = 0; tab[i] != NULL; i++) + free(tab[i]); + free(tab); +}