forked from AingeruAlvarezSanchez/Libft
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ft_doublestrlen.c
31 lines (28 loc) · 1.18 KB
/
ft_doublestrlen.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_doublestrlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aalvarez <aalvarez@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/08/21 18:25:01 by aalvarez #+# #+# */
/* Updated: 2022/08/21 18:49:20 by aalvarez ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief counts the number of lines the double pointer pointed by str has.
*
* @param str the double pointer to count.
* @return int the number of lines str has.
*/
int ft_doublestrlen(const char **str)
{
int i;
if (!str)
return (0);
i = 0;
while (str[i])
i++;
return (i);
}