diff --git a/ex02/src/main.cpp b/ex02/src/main.cpp index c9afcdb..59ad281 100644 --- a/ex02/src/main.cpp +++ b/ex02/src/main.cpp @@ -24,14 +24,39 @@ int main() } } - std::cout << "Fill and get"; + std::cout << "Fill and get" << std::endl; { unsigned int size = 10; Array t(size); for (unsigned int i = 0; i != size; i++) t[i] = i; for (unsigned int i = 0; i != size; i++) - std::cout << i << std::endl; + std::cout << t[i] << std::endl; + } + std::cout << std::endl; + + std::cout << "Copy and get" << std::endl; + { + unsigned int size = 10; + Array t(size); + for (unsigned int i = 0; i != size; i++) + t[i] = i; + Array b(t); + for (unsigned int i = 0; i != size; i++) + std::cout << b[i] << std::endl; + } + std::cout << std::endl; + + std::cout << "operator = and get" << std::endl; + { + unsigned int size = 10; + Array t(size); + for (unsigned int i = 0; i != size; i++) + t[i] = i; + Array b; + b = t; + for (unsigned int i = 0; i != size; i++) + std::cout << b[i] << std::endl; } std::cout << std::endl; }