提醒出现一个问题,请关闭该程序。这是什么原因啊

#define STACK_INIT_SIZE 100;
#define stackincrement 10;
#include<iostream.h>
#include <stdlib.h>
typedef struct bitnode
{
char data;
struct bitnode *lchild,*rchild;
}bitnode,*bitree;
typedef struct
{
bitnode *base;
bitnode *top;
int stacksize;
}sqstack;
/**
void initstack(sqstack &s);
int stackempty(sqstack s);
void push(sqstack &s,bitree T);
bitree gettop(sqstack s,bitree T);
bitree pop(sqstack &s,bitree T);
bitree creatbitree();
void preorder(bitree T);

void main()
{
bitree T;
cout<<"创建树";
T=creatbitree();
preorder(T);
}
**/
void initstack(sqstack &s)
{
s.base=(bitree)malloc(sizeof(bitnode));
s.top=s.base;
s.stacksize=STACK_INIT_SIZE;
}
void push(sqstack &s,bitree e)//为什么用bitnode
{
s.top=e;
s.top++;
}
bitree gettop(sqstack s,bitree e)
{
// if(s.top=s.base)
// return 0;
e=(s.top-1);
return e;
}
bitree pop(sqstack &s)
{
// if(s.base=s.top)
// return 0;
s.top--;
free(s.top);
return s.top;
}
int stackempty(sqstack s)
{
if(s.base=s.top)
return 1;
else
return 0;
}
bitree creatbitree()
{
bitree T;
char a;
cout<<a;
if(a==' ')
T=NULL;
else
{
T->data=a;
T->lchild=creatbitree();
T->rchild=creatbitree();
}
return (T);
}
void preorder(bitree T)
{
sqstack s;
bitree p=T;
initstack(s);
while(!stackempty(s))
{
if(p)
{
push(s,p);
p=p->lchild;
}
else
{
p=(bitnode *)malloc(sizeof(bitnode));
p=pop(s);
cout<<p->data;
p=p->rchild;
}
}
}
void main()
{
bitree T;
cout<<"创建树";
T=creatbitree();
preorder(T);
}

第1个回答  2017-11-11
重新下载或重启电脑看看追问

可是运行别的程序是可以的

第2个回答  2017-11-11
登黄鹤楼(崔颢)
第3个回答  2017-11-11
无题·来是空言去绝踪(李商隐)
第4个回答  2017-11-11
在狱咏蝉(骆宾王)
第5个回答  2017-11-11
江乡故人偶集客舍(戴叔伦)

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网