Files
mmoat/lib/libft/srcs/mem/ft_memcpy.c
gazhonsepaskwa 09c2cb5b3e base struct
2025-01-13 13:21:53 +01:00

30 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nalebrun <nalebrun@student.s19.be> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/11 09:21:39 by nalebrun #+# #+# */
/* Updated: 2024/11/25 16:15:09 by nalebrun ### ########.fr */
/* */
/* ************************************************************************** */
#include "../../libft.h"
void *ft_memcpy(void *dst, const void *src, size_t n)
{
unsigned char *pdst;
const unsigned char *psrc;
size_t i;
if (!dst && !src)
return (0);
pdst = (unsigned char *)dst;
psrc = (const unsigned char *)src;
i = -1;
while (++i < n)
pdst[i] = psrc[i];
return (dst);
}