30 lines
1.2 KiB
C
30 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_memcpy.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: rzy <ry@student.42angouleme.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2026/08/23 22:39:05 by rzy #+# #+# */
|
|
/* Updated: 2026/08/23 22:42:56 by rzy ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
#include "libft.h"
|
|
|
|
void *ft_memcpy(void *dest, const void *src, size_t n)
|
|
{
|
|
unsigned char *dest_ptr;
|
|
unsigned char *src_ptr;
|
|
size_t i;
|
|
|
|
dest_ptr = (unsigned char *)dest;
|
|
src_ptr = (unsigned char *)src;
|
|
i = 0;
|
|
while (i < n)
|
|
{
|
|
dest_ptr[i] = src_ptr[i];
|
|
++i;
|
|
}
|
|
return (dest);
|
|
}
|