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);