33 lines
1.1 KiB
C
33 lines
1.1 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* ft_memcpy.c :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2022/09/27 09:42:11 by cchauvet #+# #+# */
|
||
|
/* Updated: 2022/09/29 11:50:17 by cchauvet ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "libft.h"
|
||
|
|
||
|
void *ft_memcpy(void *dest, const void *src, size_t n)
|
||
|
{
|
||
|
char *tab1;
|
||
|
char *tab2;
|
||
|
size_t i;
|
||
|
|
||
|
if (dest == NULL && src == NULL)
|
||
|
return (dest);
|
||
|
tab1 = dest;
|
||
|
tab2 = (void *) src;
|
||
|
i = 0;
|
||
|
while (i < n)
|
||
|
{
|
||
|
tab1[i] = tab2[i];
|
||
|
i++;
|
||
|
}
|
||
|
return (tab1);
|
||
|
}
|