用C++编写数制转换(栈),为什么一直出错啊,请大神指点 #include<iostream> #include<stack> using namespace std; #define MAXSIZE 100 typedef struct { int *base; int *top; int stacksize; }SqStack; void InitStack(SqStack &S) { S.base=new int[MAXSIZE]; S.top=S.base; S.stacksize=MAXSIZE; } void Push(SqStack &S,int e) { if(S.top-S.base==S.stacksize)return; *S.top++=e; } void Pop(SqStack &S,int &e) { if(S.top==S.base)return; e=*--S.top; } void StackEmpty(SqStack &s) { S.top!=S.base; } void conversion(int N) { InitStack(S); while(N) { Push(S,N%8); N=N/8; } while(!StackEmpty(S)) { Pop(S,e); cout<<e; } } int main() { conversion(12); }