-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strcpy.c
38 lines (33 loc) · 1.25 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* test.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dnessaiv <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/08/10 20:13:59 by dnessaiv #+# #+# */
/* Updated: 2016/08/10 20:28:26 by dnessaiv ### ########.fr */
/* */
/* ************************************************************************** */
void ft_putstr(char *str);
char ft_strcpy(char *dest, char *src)
{
int dest_index;
int src_index;
dest_index = 0;
src_index = 0;
while (src_index != '\0')
{
dest[dest_index] = src[src_index];
++dest_index;
++src_index;
}
return (*dest);
}
int main(void)
{
char destination[] = "Sup";
ft_strcpy(destination, "Hello, everybody");
ft_putstr(destination);
return (0);
}