aboutsummaryrefslogtreecommitdiff
path: root/list.cpp
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2021-11-20 22:50:45 +0000
committerAryadev Chavali <aryadev@aryadevchavali.com>2021-11-20 22:51:25 +0000
commitcae91a793cec40e20d1fbe12b07caf9d5018490c (patch)
tree3433ccdebc06eff6c58dc325ba1435e056d22683 /list.cpp
parentfc6fc4032b54a5a8a8aababa3d5f16f8b5595507 (diff)
downloadalgorithms-cae91a793cec40e20d1fbe12b07caf9d5018490c.tar.gz
algorithms-cae91a793cec40e20d1fbe12b07caf9d5018490c.tar.bz2
algorithms-cae91a793cec40e20d1fbe12b07caf9d5018490c.zip
(list)+first test with appends and output
Main now uses append and cout mechanisms for a simple program!
Diffstat (limited to 'list.cpp')
-rw-r--r--list.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/list.cpp b/list.cpp
index 009ed9a..da9ad4f 100644
--- a/list.cpp
+++ b/list.cpp
@@ -46,5 +46,9 @@ std::ostream& operator<<(std::ostream& ostream, const List<T> *lst)
int main(void)
{
+ auto lst = append<int>(NULL, 1);
+ for (int i = 2; i < 10; ++i)
+ lst = append(lst, i);
+ std::cout << lst << std::endl;
return 0;
}