aboutsummaryrefslogtreecommitdiff
path: root/cpp01/ex00/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp01/ex00/main.cpp')
-rw-r--r--cpp01/ex00/main.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/cpp01/ex00/main.cpp b/cpp01/ex00/main.cpp
new file mode 100644
index 0000000..c8aa0b8
--- /dev/null
+++ b/cpp01/ex00/main.cpp
@@ -0,0 +1,24 @@
+#include <iostream>
+#include "Pony.hpp"
+
+void ponyOnTheHeap()
+{
+ Pony *p = new Pony(200, 100);
+ p->say_hello();
+ p->run();
+ delete p;
+}
+
+void ponyOnTheStack()
+{
+ Pony p(200, 100);
+ p.say_hello();
+ p.run();
+}
+
+int main()
+{
+ ponyOnTheHeap();
+ ponyOnTheStack();
+ return 0;
+}