链栈(未完成)

结构体定义

1
2
3
4
5
6
7
8
9
10
typedef int ElemType;
typedef bool Status;
typedef true TRUE;
typedef false FALSE;

typedef struct SNode{
ElemType data;
struct SNode *next;
int length;
}SNode, *LinkStack;

初始化

1
2
3
4
5
6
Status InitLinkStack(LinkStack &S){
S = NULL;
S->length = 0;
if(S->length == 0) return TRUE;
return FALSE;
}