-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memcpy.c
30 lines (27 loc) · 1.15 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: delin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/17 12:43:16 by delin #+# #+# */
/* Updated: 2018/05/03 10:13:55 by delin ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *to, const void *from, size_t n)
{
unsigned char *src;
unsigned char *dest;
src = (unsigned char *)from;
dest = (unsigned char *)to;
while (n > 0)
{
*dest = *src;
dest = dest + 1;
src = src + 1;
n = n - 1;
}
return (void *)(to);
}