-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memcpy.c
More file actions
34 lines (31 loc) 路 1.26 KB
/
Copy pathft_memcpy.c
File metadata and controls
34 lines (31 loc) 路 1.26 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
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hceviz <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/30 17:26:11 by hceviz #+# #+# */
/* Updated: 2024/12/10 16:28:04 by hceviz ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
//we are working in address level
//that is why using unsigned char is a good practice
void *ft_memcpy(void *dest, const void *src, size_t n)
{
unsigned char *dst;
unsigned char *source;
size_t i;
i = 0;
dst = (unsigned char *)dest;
source = (unsigned char *)src;
if (!dest && !src)
return (dest);
while (i < n)
{
dst[i] = source[i];
i++;
}
return (dst);
}