-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathft_memcpy.c
More file actions
32 lines (29 loc) · 1.22 KB
/
ft_memcpy.c
File metadata and controls
32 lines (29 loc) · 1.22 KB
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_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mimeyer <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/05/19 11:51:53 by mimeyer #+# #+# */
/* Updated: 2019/05/28 11:27:45 by mimeyer ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *str1, const void *str2, size_t n)
{
unsigned int i;
unsigned char *dest;
unsigned const char *str;
if (str1 == NULL && str2 == NULL)
return (NULL);
i = 0;
dest = (unsigned char *)str1;
str = (unsigned char *)str2;
while (i < n)
{
*((char *)dest + i) = *((char *)str + i);
i++;
}
return (dest);
}