ft_memcpy.c 1.1 KB

123456789101112131415161718192021222324252627
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_memcpy.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2014/11/08 17:31:08 by mazimi #+# #+# */
  9. /* Updated: 2014/12/02 15:56:19 by mazimi ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "../libft.h"
  13. void *ft_memcpy(void *dst, const void *src, size_t n)
  14. {
  15. size_t i;
  16. char *dst2;
  17. char *src2;
  18. dst2 = dst;
  19. src2 = (char *)src;
  20. i = -1;
  21. while (++i < n)
  22. dst2[i] = src2[i];
  23. return ((void *)dst2);
  24. }