libft
Loading...
Searching...
No Matches
ft_memcpy.c
Go to the documentation of this file.
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* ft_memcpy.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: tspoof <tspoof@student.hive.fi> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2022/10/26 17:14:46 by tspoof #+# #+# */
9/* Updated: 2022/12/15 18:48:32 by tspoof ### ########.fr */
10/* */
11/* ************************************************************************** */
12
13#include "libft.h"
14
15void *ft_memcpy(void *dst, const void *src, size_t n)
16{
17 size_t i;
18
19 if (dst != src)
20 {
21 i = 0;
22 while (i < n)
23 {
24 ((unsigned char *)dst)[i] = ((unsigned char *)src)[i];
25 i++;
26 }
27 }
28 return (dst);
29}
void * ft_memcpy(void *dst, const void *src, size_t n)
Copies memory to destination.
Definition ft_memcpy.c:15