From 10fe1747d3b63ca1533ce55b2d3feae8d1e16948 Mon Sep 17 00:00:00 2001 From: Sambo Chea Date: Sat, 1 Aug 2020 22:04:44 +0700 Subject: [PATCH] Add element message alert --- tests/linkedlist.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/linkedlist.c b/tests/linkedlist.c index 63e9c84..c72eb4c 100644 --- a/tests/linkedlist.c +++ b/tests/linkedlist.c @@ -98,6 +98,8 @@ void add_first(int element) // set the next of head into null head->next = NULL; + printf("Element %d has been added into the first!", element); + // return or end this process return; } @@ -108,6 +110,8 @@ void add_first(int element) // replace the head node from current node head = node; + + printf("Element %d has been added into the first!", element); } void add_last(int element) @@ -136,7 +140,7 @@ void add_last(int element) } temp->next = node; - node->next = NULL; + node->next = NULL; head = temp; }