libft
src
ft_memcpy.c
Go to the documentation of this file.
1
/* ************************************************************************** */
3
/* */
4
/* ::: :::::::: */
5
/* ft_memcpy.c :+: :+: :+: */
6
/* +:+ +:+ +:+ */
7
/* By: unite <marvin@42.fr> +#+ +:+ +#+ */
8
/* +#+#+#+#+#+ +#+ */
9
/* Created: 2019/09/05 16:19:33 by unite #+# #+# */
10
/* Updated: 2020/07/16 02:57:03 by unite ### ########.fr */
11
/* */
12
/* ************************************************************************** */
13
14
#include "
libft.h
"
15
20
void
*
ft_memcpy
(
void
*dst,
const
void
*src,
size_t
n)
21
{
22
size_t
i;
23
unsigned
char
*dst1;
24
unsigned
char
*src1;
25
26
if
(!dst && !src)
27
return
(NULL);
28
i = 0;
29
dst1 = (
unsigned
char
*)dst;
30
src1 = (
unsigned
char
*)src;
31
while
(i < n)
32
{
33
dst1[i] = src1[i];
34
i++;
35
}
36
return
(dst);
37
}
ft_memcpy
void * ft_memcpy(void *dst, const void *src, size_t n)
Replicates behaviour of memcpy from libc.
Definition:
ft_memcpy.c:20
libft.h
Generated by
1.8.16