summaryrefslogtreecommitdiff
path: root/libft/ft_memcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'libft/ft_memcpy.c')
-rw-r--r--libft/ft_memcpy.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libft/ft_memcpy.c b/libft/ft_memcpy.c
new file mode 100644
index 0000000..aa62b88
--- /dev/null
+++ b/libft/ft_memcpy.c
@@ -0,0 +1,25 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_memcpy.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: kdx <kdx @student.42angouleme.fr +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2022/09/27 06:34:25 by kdx #+# #+# */
+/* Updated: 2022/10/14 02:27:38 by kdx ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft.h"
+
+void *ft_memcpy(void *dest, const void *src, size_t n)
+{
+ if (dest == src)
+ return (dest);
+ while (n > 0)
+ {
+ n -= 1;
+ ((char *)dest)[n] = ((char *)src)[n];
+ }
+ return (dest);
+}