From 52a866baba3cbb05ecf0be88f1b50991b4a26b52 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 15 Apr 2020 09:28:09 +0200 Subject: cpp08 probably done, ex02 has a useless file in this implementation? --- cpp08/ex02/main.cpp | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 cpp08/ex02/main.cpp (limited to 'cpp08/ex02/main.cpp') diff --git a/cpp08/ex02/main.cpp b/cpp08/ex02/main.cpp new file mode 100644 index 0000000..f3b1ec5 --- /dev/null +++ b/cpp08/ex02/main.cpp @@ -0,0 +1,45 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.cpp :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: charles +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/15 07:30:43 by charles #+# #+# */ +/* Updated: 2020/04/15 09:21:12 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include "mutantstack.hpp" + +int main() +{ + MutantStack mstack; + + mstack.push(5); + mstack.push(17); + + std::cout << mstack.top() << std::endl; + + mstack.pop(); + + std::cout << mstack.size() << std::endl; + + mstack.push(3); + mstack.push(5); + mstack.push(737); + mstack.push(0); + MutantStack::iterator it = mstack.begin(); + MutantStack::iterator ite = mstack.end(); + + ++it; + --it; + while (it != ite) + { + std::cout << *it << std::endl; + ++it; + } + std::stack s(mstack); + return 0; +} -- cgit