-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strcat.c
30 lines (27 loc) · 1.07 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: knzeng-e <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/03/13 22:40:18 by knzeng-e #+# #+# */
/* Updated: 2016/03/29 15:57:28 by knzeng-e ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strcat(char *dest, const char *src)
{
int i;
int j;
j = 0;
while (dest[j])
j++;
i = -1;
while (src[++i])
{
dest[j++] = src[i];
}
dest[j] = '\0';
return (dest);
}