标签:empty names style def 实现 class mes tst let
#include<iostream> using namespace std; typedef struct StackNode *LinkStack; struct StackNode { int data; struct StackNode *next; }; LinkStack s; void InitStack(LinkStack &s) { s = NULL; } bool StackEmpty(LinkStack &s) { if (s = NULL) return true; else return false; } void Push(LinkStack &s, int e) { LinkStack p = new StackNode; if (!p) { cout << "error" << endl; return; } p->data = e; p->next = s; s = p; } void Pop(LinkStack &s, int &e) { if (s == NULL) { cout << "error" << endl; return; } e = s->data; LinkStack p = s; s = s->next; delete p; } int GetTop(LinkStack &s) { if (s == NULL) { cout << "error" << endl; return -1; } else return s->data; }
标签:empty names style def 实现 class mes tst let
原文地址:https://www.cnblogs.com/h694879357/p/11622891.html