From 1de596dd9242b677d6b47b51db98ce98feb95465 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 14 Dec 2020 15:30:28 +0100 Subject: Updated cpp07 files with new subject --- cpp07/ex01/main.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 cpp07/ex01/main.cpp (limited to 'cpp07/ex01/main.cpp') 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 +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/14 20:02:19 by charles #+# #+# */ +/* Updated: 2020/12/14 15:16:32 by cacharle ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include +#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); + + 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); + + 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); + + return 0; +} -- cgit