请问为什么在S == NULL那里出错了

【手机】 请问为什么在S == NULL那里出错了

--------------------------------------------

傻大方资讯为您精选的网友回复(供您参考):

[电脑使用技巧]#include#include#define MAXSIZE 100enum Status{ OK = 1, ERROR = 0, OVERFLOW = -1};typedef int ElemType;struct SqStack{ ElemType *top; ElemType *base; int sizeStack;};Status InitStack(SqStack &S){ S.base = new ElemType[MAXSIZE]; if(S.base == NULL) { return OVERFLOW; } else { S.top = S.base; S.sizeStack = MAXSIZE; return OK; }}Status Push(SqStack &S, ElemType e){ if(S == NULL) { return ERROR; } else { if(S.top-S.base == S.sizeStack) { return ERROR; } else { *S.top=e; S.top++; return OK; } }}int main(){ SqStack stack; if(InitStack(stack) == ERROR) { printf("栈初始化失败!\n"); } return 0;}

--------------------------------------------