typedef char Elem;
typedef struct LStack {
Elem data;
struct LStack *next;
}LSNode,*PtrLSNode;
int InitLSNode_Head(PtrLSNode *LSNode);
int PushLSNode(PtrLSNode *LSNode, Elem *e);
int PopLSNode(PtrLSNode *LSNode, Elem *e);
int PopLSNode(PtrLSNode *LSNode, Elem *e) {
PtrLSNode p = NULL;
p = (*LSNode)->next;
if (NULL == (*LSNode)->next) return FALSE;
*e = p->data;
(*LSNode)->next = p->next;
free(p);
return OK;
}
BIG阳
相关分类