23 lines
328 B
C
23 lines
328 B
C
#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;
|
|
} |