-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memcpy.c
31 lines (28 loc) · 1.09 KB
/
ft_memcpy.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ppiques <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/11/17 15:55:42 by ppiques #+# #+# */
/* Updated: 2020/12/02 19:39:42 by ppiques ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dest, const void *src, size_t n)
{
size_t i;
char *s1;
char *s2;
s1 = (char *)src;
s2 = (char *)dest;
i = 0;
while (n > 0)
{
s2[i] = s1[i];
i++;
n--;
}
return (dest);
}