diff options
Diffstat (limited to 'cpp08/ex02/main.cpp')
| -rw-r--r-- | cpp08/ex02/main.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
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 <charles.cabergs@gmail.com> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/04/15 07:30:43 by charles #+# #+# */ +/* Updated: 2020/04/15 09:21:12 by charles ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include <iostream> +#include "mutantstack.hpp" + +int main() +{ + MutantStack<int> 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<int>::iterator it = mstack.begin(); + MutantStack<int>::iterator ite = mstack.end(); + + ++it; + --it; + while (it != ite) + { + std::cout << *it << std::endl; + ++it; + } + std::stack<int> s(mstack); + return 0; +} |
