-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_split_printf2.c
39 lines (35 loc) · 1.16 KB
/
ft_split_printf2.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
32
33
34
35
36
37
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_split_printf2.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: toramo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/08 11:49:01 by toramo #+# #+# */
/* Updated: 2023/11/08 11:55:50 by toramo ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int count_words_printf(const char *s)
{
int i;
int c;
c = 0;
i = 0;
while (s[i] != 0)
{
c++;
i += ft_strlen_printf(&s[i]);
}
return (c);
}
char **ft_free_arr_printf(char **strs, int i)
{
while (i >= 0)
{
free(strs[i]);
i--;
}
free(strs);
return (0);
}