-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathft_memcpy.c
33 lines (29 loc) · 1.29 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
23
24
25
26
27
28
29
30
31
32
33
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adiaz-lo <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/01/13 09:46:05 by adiaz-lo #+# #+# */
/* Updated: 2020/01/13 09:49:59 by adiaz-lo ### ########.fr */
/* */
/* ************************************************************************** */
/*
** Copies 'n' bytes from memory area 'src' to memory of 'dst'.
** For further information, please check the Standard C Library function
** 'memcpy(void *dst, const void *src, size_t n)'
*/
#include "libft.h"
void *ft_memcpy(void *dst, const void *src, size_t n)
{
char *source;
char *dest;
source = (char *)src;
dest = (char *)dst;
if (!dst && !src)
return (dst);
while (n--)
*dest++ = *source++;
return (dst);
}