-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memcpy.c
25 lines (22 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mesafi <mesafi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/30 21:17:33 by mesafi #+# #+# */
/* Updated: 2020/01/20 13:29:48 by mesafi ### ########.fr */
/* */
/* ************************************************************************** */
#include <string.h>
void *ft_memcpy(void *dest, const void *src, size_t n)
{
unsigned char *s1;
unsigned char *s2;
s1 = (unsigned char *)dest;
s2 = (unsigned char *)src;
while (n--)
*s1++ = *s2++;
return (dest);
}