-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strcat.c
29 lines (27 loc) · 1.09 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: amahla <amahla@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/14 10:56:18 by amahla #+# #+# */
/* Updated: 2022/03/14 12:26:12 by amahla ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strcat(char *dest, char *src)
{
int i;
int j;
i = 0;
j = 0;
while (dest && *(dest + i))
i++;
while (src && *(src + j))
{
*(dest + i + j) = *(src + j);
j++;
}
*(dest + i + j) = '\0';
return (dest);
}