-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memcpy.c
22 lines (20 loc) · 1.07 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: sperez-p <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/08/20 12:42:38 by sperez-p #+# #+# */
/* Updated: 2021/08/20 17:14:55 by sperez-p ### ########.fr */
/* */
/* ************************************************************************** */
#include <stddef.h>
void *ft_memcpy(void *dst, const void *src, size_t n)
{
if (!dst && !src)
return (NULL);
while (n--)
*(char *)(dst + n) = *(char *)(src + n);
return (dst);
}