-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_memcpy.c
27 lines (24 loc) · 1.11 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bhagenlo <[email protected]. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/03/28 19:06:34 by bhagenlo #+# #+# */
/* Updated: 2022/04/09 12:20:12 by bhagenlo ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
void *ft_memcpy(void *dst, const void *src, size_t n)
{
char *ch_dest;
char *ch_src;
ch_dest = (char *) dst;
ch_src = (char *) src;
if (src == dst)
return (dst);
while (n--)
*ch_dest++ = *ch_src++;
return (dst);
}