Libft
42 Libft library documentation
Loading...
Searching...
No Matches
ft_memcpy.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* ft_memcpy.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: raphalme <raphalme@student.42.fr> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/12/29 18:42:00 by raphalme #+# #+# */
9/* Updated: 2026/04/14 10:45:22 by raphalme ### ########.fr */
10/* */
11/* ************************************************************************** */
12
13#include <stdlib.h>
14
25void *ft_memcpy(void *dest, const void *src, size_t n)
26{
27 unsigned char *d;
28 const unsigned char *s;
29
30 if (!dest && !src)
31 return (NULL);
32 d = (unsigned char *)dest;
33 s = (const unsigned char *)src;
34 while (n--)
35 *d++ = *s++;
36 return (dest);
37}
void * ft_memcpy(void *dest, const void *src, size_t n)
Copies bytes from source to destination.
Definition ft_memcpy.c:25