From a6cbf2ae0d6d953a2e9da7f069c184853fca3cc3 Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Sat, 10 Feb 2024 13:37:34 -0800 Subject: errors fixed, vectors and lists made, still working on lists --- Project1/helper.cpp | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'Project1/helper.cpp') diff --git a/Project1/helper.cpp b/Project1/helper.cpp index 85b6ac4..de05926 100644 --- a/Project1/helper.cpp +++ b/Project1/helper.cpp @@ -1,8 +1,14 @@ +#include "helper.h" #include #include #include -#include "helper.h" +#include +using std::cin; +using std::cout; +using std::endl; +using std::array; +using std::vector; void Print(int(&cArray)[SIZE]) @@ -13,10 +19,28 @@ void Print(int(&cArray)[SIZE]) } } -void Print_std(std::array stdArray[]) +void Print(const std::array &stdArray) { - for (auto i = 0u; i < stdArray->size(); i++) + for (auto i = 0u; i < stdArray.size(); i++) { std::cout << i << std::endl; } } + +void Print(const std::vector &myVector) +{ + for (auto& i : myVector) + { + std::cout << i << std::endl; + } + +} + +void Print(const std::list& myList) +{ + for (auto& i : myList) + { + std::cout << i << std::endl; + } + +} \ No newline at end of file -- cgit v1.2.3