-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_lstlen.c
43 lines (38 loc) · 1.18 KB
/
ft_lstlen.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
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_lstlen.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: afillion <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/12/09 15:50:50 by afillion #+# #+# */
/* Updated: 2015/12/16 14:36:46 by afillion ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
int ft_lstlen(t_list *lst)
{
int i;
t_list *tmp;
i = 0;
tmp = lst;
while (tmp)
{
tmp = tmp->next;
i++;
}
return (i);
}
char *hash_vs_letter(char *s, char hash, char letter)
{
size_t i;
i = 0;
while (s[i])
{
if (s[i] == hash)
s[i] = letter;
else
i++;
}
return (s);
}