秦时明月声优:编了个小程序,可是少了头文件,也不知用哪个头文件,谁帮我看一下啊,谢谢

来源:百度文库 编辑:神马品牌网 时间:2024/04/30 05:04:04
#define STACK_INIT_SIZE MAXSIZE
#define STACKINCREMENT 10
typedef struct {
int *base;
int *top;
int stacksize;
}SqStack

#include <intshcut.h>
#include<stdio.h>
#include<math.h>
#include <status.h>

void Conversion(){
InitStack(s);
scanf("%d",&n);
while(n){
push(s,(n%2));
n=n/2;
}
while(!stackEmpty(S)){
Pop(s,e);
printf("%d",e);
}
}
Status InitStack(SqStack &S){
S.base=(int *)malloc(STACK_INIT_SIZE * sizeof(int));
if(!S.base)exit(OVERFLOW);
S.top=S.base;
S.Stacksize=STACK_INIT_SIZE;
return ok;
}
Status Push(SqStack &S, int e){
if((S.top-S.base)>S.stacksize){
S.base=(int *)realloc(S.base,(S.stacksize+STACKINCREMENT*sizeof(int)));
if(!s.base)exit(OVERFLOW);
S.top=S.base+S.stacksize;
S.stacksize+=STACKINCREMENT;
}
*S.top++=e;
return ok;
}
Status Pop(SqStack &s,int &e){
if(S.top==S.base)return ERROR;
e=*--S.top;
return OK;
}

c:\program files\microsoft visual studio\vc98\include\isguids.h(13) : error C2146: syntax error : missing ';' before identifier 'DEFINE_GUID'
c:\program files\microsoft visual studio\vc98\include\isguids.h(13) : fatal error C1004: unexpected end of file found
执行 cl.exe 时出错.

连主函数都没有