/*若栈不空,删除S的栈顶元素,用e返回其值,并返回OK,否则返回ERROR*/ Status Pop(LinkStack *S, SElemType *e) { LinkStackPtr p; if (StackEmpty(*S)) return ERROR; *e = S->top->data; p = S->top; /*将栈顶结点赋值给p*/ S->top = S->top->next; /*使得栈顶指针下移一位,指向后移结点*/ free(p); /*释放结点p*/ S->count--; return OK; }