add: tablen

This commit is contained in:
starnakin 2023-06-29 11:40:43 +02:00
parent 13f3bb0730
commit da8cce7750
3 changed files with 14 additions and 0 deletions

View File

@ -2,3 +2,4 @@
#include "./src/lst/lst.h"
#include "./src/str/str.h"
#include "./src/tab/tab.h"

5
src/tab/tab.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <stddef.h>
size_t tablen(const void** tab);

8
src/tab/tablen.c Normal file
View File

@ -0,0 +1,8 @@
#include "tab.h"
size_t tablen(const void **tab)
{
size_t i;
for (i = 0; tab[i] != NULL; i++);
return i;
}