-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strcat.c
32 lines (29 loc) · 1.14 KB
/
ft_strcat.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abkssiba <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/19 11:35:51 by abkssiba #+# #+# */
/* Updated: 2021/05/24 16:09:58 by abkssiba ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strcat(char *s1, const char *s2)
{
int len_dest;
int len_src;
int i;
i = 0;
len_src = ft_strlen(s2);
len_dest = ft_strlen(s1);
while (i < len_src)
{
s1[len_dest] = s2[i];
i++;
len_dest++;
}
s1[len_dest] = '\0';
return (s1);
}