-
Notifications
You must be signed in to change notification settings - Fork 2
/
ft_mem_count.c
executable file
·31 lines (28 loc) · 1.18 KB
/
ft_mem_count.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_mem_count.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ysoroko <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/28 19:13:17 by ysoroko #+# #+# */
/* Updated: 2020/11/28 19:13:17 by ysoroko ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft.h"
int ft_mem_count(char **str_tab)
{
int i;
int mem_count;
i = 0;
mem_count = (int)(MALLOC_SIZE_FUNCTION(str_tab));
if (str_tab != 0)
{
while (str_tab[i] != 0)
{
mem_count += (int)(MALLOC_SIZE_FUNCTION(str_tab[i]));
i++;
}
}
return (mem_count);
}