-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strcpy.c
32 lines (28 loc) · 1.19 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aviholai <aviholai@student.hive.fi> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/24 15:33:21 by aviholai #+# #+# */
/* Updated: 2022/02/04 16:46:01 by aviholai ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/*
** 'Strcpy()' (String copy) makes a copy of the second parameter string
** (char *src) into the first parameter (char *dst) and returns 'dst'..
*/
char *ft_strcpy(char *dst, const char *src)
{
size_t i;
i = 0;
while (src[i] != '\0')
{
dst[i] = src[i];
i++;
}
dst[i] = '\0';
return (dst);
}