aboutsummaryrefslogtreecommitdiff
path: root/cpp06/ex02/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp06/ex02/main.cpp')
-rw-r--r--cpp06/ex02/main.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/cpp06/ex02/main.cpp b/cpp06/ex02/main.cpp
new file mode 100644
index 0000000..17c0c3d
--- /dev/null
+++ b/cpp06/ex02/main.cpp
@@ -0,0 +1,36 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.cpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/04/15 10:00:18 by charles #+# #+# */
+/* Updated: 2020/04/15 10:05:23 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include <iostream>
+#include <cstdlib>
+#include "Base.hpp"
+#include "A.hpp"
+#include "B.hpp"
+#include "C.hpp"
+
+Base* generate(void)
+{
+ switch (rand() % 3)
+ {
+ case 0: return new A();
+ case 1: return new B();
+ case 2: return new C();
+ }
+ return NULL;
+}
+
+int main()
+{
+ srand(time(NULL));
+
+ return 0;
+}