-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memcpy.c
More file actions
33 lines (30 loc) · 1.13 KB
/
ft_memcpy.c
File metadata and controls
33 lines (30 loc) · 1.13 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hulefevr <hulefevr@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/22 09:52:13 by hulefevr #+# #+# */
/* Updated: 2024/04/22 09:54:42 by hulefevr ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dest, const void *src, size_t n)
{
int i;
char *s1;
char *s2;
s1 = (char *)dest;
s2 = (char *)src;
i = 0;
if (!s1 && !s2)
return (NULL);
while (n > 0)
{
s1[i] = s2[i];
i++;
n--;
}
return (dest);
}