-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_memcpy.c
More file actions
29 lines (26 loc) · 1.12 KB
/
ft_memcpy.c
File metadata and controls
29 lines (26 loc) · 1.12 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ldiaz-ra <ldiaz-ra@student.42madrid.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/15 11:21:52 by ldiaz-ra #+# #+# */
/* Updated: 2023/09/20 11:07:41 by ldiaz-ra ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dst, const void *src, size_t n)
{
const char *source;
char *dest;
if (!dst && !src)
return (NULL);
dest = (char *)dst;
source = (const char *)src;
while (n--)
{
*dest++ = *source++;
}
return (dst);
}