From e5bcc44b2ee08fa46d262973a19c0a8ad82cc8a9 Mon Sep 17 00:00:00 2001 From: Camille Chauvet Date: Wed, 4 Oct 2023 15:27:42 +0000 Subject: [PATCH] ex02: fix bozo bug --- ex02/src/Array.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ex02/src/Array.hpp b/ex02/src/Array.hpp index 853074c..58f1b7b 100644 --- a/ex02/src/Array.hpp +++ b/ex02/src/Array.hpp @@ -24,7 +24,7 @@ class Array Array(const Array& src) { - new T[0]; + this->_arr = new T[0]; *this = src; }; @@ -42,6 +42,7 @@ class Array new T[src._size]; for (size_t i = 0; i < src._size; i++) this->_arr[i] = src._arr[i]; + return *this; }; T& operator[](unsigned int index) const