微调与更新栈
This commit is contained in:
23
数据结构/栈/main.c
Normal file
23
数据结构/栈/main.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user