-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strcat.c
43 lines (36 loc) · 1.26 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
33
34
35
36
37
38
39
40
41
42
43
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: danalvar <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/24 22:02:46 by danalvar #+# #+# */
/* Updated: 2024/10/26 11:26:28 by danalvar ### ########.fr */
/* */
/* ************************************************************************** */
/*#include <stdio.h>*/
char *ft_strcat(char *dest, char *src)
{
int i;
int j;
i = 0;
while (dest[i] != '\0')
i++;
j = 0;
while (src[j] != '\0')
{
dest[i + j] = src[j];
j++;
}
dest[i + j] = '\0';
return (dest);
}
/*int main(void)
{
char source[] = "Hola%w Pepsicola";
char destination[] = "Adios";
ft_strcat(destination, source);
printf("%s\n", destination);
return (0);
}*/