From 338e927cf8c8e16bae42c044de18f0633c76c842 Mon Sep 17 00:00:00 2001 From: llz-long <1784386738@qq.com> Date: Thu, 17 Apr 2025 17:34:18 +0800 Subject: [PATCH] up stsck --- .gitignore | 2 ++ linked_list_stack.c | 8 ++++++++ linked_list_stack.h | 2 ++ 3 files changed, 12 insertions(+) diff --git a/.gitignore b/.gitignore index 18c2e0e..129650a 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,5 @@ Module.symvers Mkfile.old dkms.conf /.vs/Project2 +*.tlog +*.tlog diff --git a/linked_list_stack.c b/linked_list_stack.c index 283a999..02c5470 100644 --- a/linked_list_stack.c +++ b/linked_list_stack.c @@ -41,4 +41,12 @@ int pop_stack_linked(stack_linked* s) free(tmp); tmp = NULL; return flog; +} +void print_linked(stack_linked* s) { + stack_node* L = s->top; + while (L != NULL) { + printf("%d", L->value); + L = L->next; + } + printf("\n"); } \ No newline at end of file diff --git a/linked_list_stack.h b/linked_list_stack.h index 46f4765..b3dd37b 100644 --- a/linked_list_stack.h +++ b/linked_list_stack.h @@ -23,6 +23,8 @@ void push_stack_linked(stack_linked* s, elem_type value); // ³öÕ» int pop_stack_linked(stack_linked* s); +//Êä³ö +void print_linked(stack_linked* s);