aboutsummaryrefslogtreecommitdiff
path: root/cpp07/ex01/main.cpp
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-12-14 15:30:28 +0100
committerCharles Cabergs <me@cacharle.xyz>2020-12-14 15:30:28 +0100
commit1de596dd9242b677d6b47b51db98ce98feb95465 (patch)
treeacbc79883c0af843b8b999a39f96cefd48e6e390 /cpp07/ex01/main.cpp
parentb13cd117a7957f9d86ec2986b47349979325a854 (diff)
downloadpiscine_cpp-1de596dd9242b677d6b47b51db98ce98feb95465.tar.gz
piscine_cpp-1de596dd9242b677d6b47b51db98ce98feb95465.tar.bz2
piscine_cpp-1de596dd9242b677d6b47b51db98ce98feb95465.zip
Updated cpp07 files with new subject
Diffstat (limited to 'cpp07/ex01/main.cpp')
-rw-r--r--cpp07/ex01/main.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/cpp07/ex01/main.cpp b/cpp07/ex01/main.cpp
new file mode 100644
index 0000000..6ac8e82
--- /dev/null
+++ b/cpp07/ex01/main.cpp
@@ -0,0 +1,44 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* main.cpp :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/04/14 20:02:19 by charles #+# #+# */
+/* Updated: 2020/12/14 15:16:32 by cacharle ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include <iostream>
+#include "iter.hpp"
+
+int main()
+{
+ int intArray[] = {1, 2, 3, 4, 10, 20, 30, -1, -2};
+ size_t intArraySize = sizeof(intArray) / sizeof(int);
+ for (size_t i = 0; i < intArraySize; i++)
+ std::cout << intArray[i] << ", ";
+ std::cout << std::endl;
+ iter(intArray, intArraySize, timeTwo<int>);
+
+ std::cout << "--------------------------------------" << std::endl;
+
+ float floatArray[] = {1.1, 2.2, 3.3, 4.3, 10.001, 20.9, 30.3, -1.2, -2.4};
+ size_t floatArraySize = sizeof(floatArray) / sizeof(float);
+ for (size_t i = 0; i < floatArraySize; i++)
+ std::cout << floatArray[i] << ", ";
+ std::cout << std::endl;
+ iter(floatArray, floatArraySize, timeTwo<float>);
+
+ std::cout << "--------------------------------------" << std::endl;
+
+ unsigned int uintArray[] = {1, 2, 3, 4, 10, 20, 30, 100, 2000};
+ size_t uintArraySize = sizeof(uintArray) / sizeof(unsigned int);
+ for (size_t i = 0; i < uintArraySize; i++)
+ std::cout << uintArray[i] << ", ";
+ std::cout << std::endl;
+ iter(uintArray, uintArraySize, timeTwo<unsigned int>);
+
+ return 0;
+}