微调与更新栈

This commit is contained in:
2023-10-18 18:00:04 +08:00
parent bd56fdcd73
commit 37f331b842
8 changed files with 134 additions and 6 deletions

23
数据结构/栈/main.c Normal file
View File

@@ -0,0 +1,23 @@
#include <stdio.h>
#include "Stack.h"
int main(){
int *a;
SqStack stack;
InitStack(&stack,20,sizeof(int));
for(int i=0;i<20;i++){
a=(int *)PushStack(&stack);
*a=i;
}
for(int i=0;i<20;i++){
printf("%d ",*(int *)(stack.container+i*stack.NodeSize));
}
return 0;
}