summaryrefslogtreecommitdiff
path: root/ex00
diff options
context:
space:
mode:
Diffstat (limited to 'ex00')
-rw-r--r--ex00/Zombie.hpp6
-rw-r--r--ex00/main.cpp6
-rw-r--r--ex00/newZombie.cpp10
3 files changed, 18 insertions, 4 deletions
diff --git a/ex00/Zombie.hpp b/ex00/Zombie.hpp
index c9f780f..ecc2352 100644
--- a/ex00/Zombie.hpp
+++ b/ex00/Zombie.hpp
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/10 10:26:18 by dkaiser #+# #+# */
-/* Updated: 2025/02/10 10:38:18 by dkaiser ### ########.fr */
+/* Updated: 2025/02/10 10:56:19 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -23,6 +23,8 @@ class Zombie
void announce(void);
private:
std::string name;
-}
+};
+
+Zombie* newZombie(std::string name);
#endif
diff --git a/ex00/main.cpp b/ex00/main.cpp
index 820c484..295f75f 100644
--- a/ex00/main.cpp
+++ b/ex00/main.cpp
@@ -6,10 +6,14 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/10 10:24:56 by dkaiser #+# #+# */
-/* Updated: 2025/02/10 10:27:00 by dkaiser ### ########.fr */
+/* Updated: 2025/02/10 10:56:08 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
+#include "Zombie.hpp"
+
int main(void)
{
+ Zombie* z1 = newZombie("z1");
+ delete z1;
}
diff --git a/ex00/newZombie.cpp b/ex00/newZombie.cpp
index 74b9ca8..916a3a9 100644
--- a/ex00/newZombie.cpp
+++ b/ex00/newZombie.cpp
@@ -6,7 +6,15 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/10 10:27:26 by dkaiser #+# #+# */
-/* Updated: 2025/02/10 10:27:27 by dkaiser ### ########.fr */
+/* Updated: 2025/02/10 10:56:54 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
+#include "Zombie.hpp"
+
+Zombie* newZombie(std::string name)
+{
+ Zombie* zombie = new Zombie(name);
+ zombie->announce();
+ return zombie;
+}