-
Notifications
You must be signed in to change notification settings - Fork 1
/
ft_strcpy.c
39 lines (33 loc) · 1.21 KB
/
ft_strcpy.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jony <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/18 15:37:09 by mhasan #+# #+# */
/* Updated: 2019/11/04 22:06:56 by jony ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strcpy(char *dst, char *src)
{
int i;
i = 0;
while (src[i] != '\0')
{
dst[i] = src[i];
i++;
}
dst[i] = '\0';
return (dst);
}
int main(void)
{
char src[50], dest[50];
strcpy(src, "This is source");
strcpy(dest, "This is destination");
//ft_strcpy(str1, str2);
printf("%s\n%s", src, dest);
return (0);
}