The Makefile will be added later, because I'm too lazy to write it
again, when there is a one for the CPP Module 00 already. It is just on
another PC, from which I had not pushed yet.
--- /dev/null
+#include "Zombie.h"
+#include <iostream>
+#include <string>
+
+Zombie::Zombie(std::string name): m_name(name)
+{
+}
+
+Zombie &Zombie::operator=(const Zombie &zombie)
+{
+ m_name = zombie.m_name;
+ return (*this);
+}
+
+Zombie::Zombie(const Zombie &zombie)
+{
+ *this = zombie;
+}
+
+Zombie::~Zombie(void)
+{
+ std::cout << m_name << " is being deconstructed\n";
+}
+
+void Zombie::announce(void)
+{
+ std::cout << m_name << ": BraiiiiiiinnnzzzZ...\n";
+}
--- /dev/null
+#ifndef ZOMBIE_H
+# define ZOMBIE_H
+
+# include <string>
+
+class Zombie
+{
+ private:
+ std::string m_name;
+
+ public:
+ Zombie(std::string name);
+ Zombie &operator=(const Zombie &zombie);
+ Zombie(const Zombie &zombie);
+ ~Zombie();
+
+ void announce(void);
+};
+
+#endif // ZOMBIE_H
--- /dev/null
+#include "Zombie.h"
+
+
+Zombie *newZombie(std::string name);
+void randomChump(std::string name);
+
+int main(void)
+{
+ Zombie zombie("Edd");
+ Zombie *zombie_p;
+
+ zombie_p = newZombie("Ed");
+ zombie_p->announce();
+ zombie.announce();
+ randomChump("Eddy");
+ delete zombie_p;
+ return (0);
+}
--- /dev/null
+#include "Zombie.h"
+#include <string>
+
+Zombie *newZombie(std::string name)
+{
+ return (new Zombie(name));
+}
+
--- /dev/null
+#include "Zombie.h"
+#include <string>
+
+void randomChump(std::string name)
+{
+ Zombie chump(name);
+
+ chump.announce();
+}