/ libft / ft_memcpy.c
ft_memcpy.c
 1  /* ************************************************************************** */
 2  /*                                                                            */
 3  /*                                                        :::      ::::::::   */
 4  /*   ft_memcpy.c                                        :+:      :+:    :+:   */
 5  /*                                                    +:+ +:+         +:+     */
 6  /*   By: gychoi <marvin@42.fr>                      +#+  +:+       +#+        */
 7  /*                                                +#+#+#+#+#+   +#+           */
 8  /*   Created: 2022/07/07 20:06:28 by gychoi            #+#    #+#             */
 9  /*   Updated: 2022/07/12 18:43:16 by gychoi           ###   ########.fr       */
10  /*                                                                            */
11  /* ************************************************************************** */
12  
13  #include "libft.h"
14  
15  void	*ft_memcpy(void *dst, const void *src, size_t n)
16  {
17  	size_t	i;
18  
19  	i = 0;
20  	if (!dst && !src)
21  		return (NULL);
22  	while (i < n)
23  	{
24  		((unsigned char *)dst)[i] = ((unsigned char *)src)[i];
25  		i++;
26  	}
27  	return (dst);
28  }