运行程序出现的错误请各位看看是怎么了
" border="0" />请各位高手看看是怎么了
程序在这
#include <conio.h>#include<stdio.h>
#include<stdlib.h>
#define maxsize 100
typedef struct node{
char data;
struct node *lchild,*rchild;
}bt;
createbt(bt **T)
{char ch;
scanf ("%c",&ch);
if(ch==' ') *T=NULL;
else {*T=(bt *)malloc(sizeof (bt));
(*T)->data =ch;
createbt(&((*T)->lchild)) ;
createbt(&((*T)->rchild)) ;
}
}
preorder (bt *t)
{ printf("%c",t->data);
preorder(t->lchild);
preorder(t->rchild);
getch();
}
inorder (bt *t)
{ preorder(t->lchild);
printf("%c",t->data);
preorder(t->rchild);
}
postorder (bt *t)
{ preorder(t->lchild);
preorder(t->rchild);
printf("%c",t->data);
}
main()
{
int i,j,a;
bt *h;
createbt(&h);
window(0,0,5,5);
textbackground(4);
textcolor(0);
clrscr();
gotoxy(10,10) ;
for (i=5;i<=20;i++) /*左右框*/
{ gotoxy(10,i);
printf("*");
gotoxy(70,i);
printf("*");
}
for (j=10;j<=70;j++)
{ gotoxy(j,5);
printf("*");
gotoxy(j,20);
printf("*"); /*上下框*/
}
gotoxy(33,7);
printf(" 1 preorder ") ;
gotoxy(33,11);
printf(" 2 inorder ") ;
gotoxy(33,15);
printf(" 3 postorder ") ;
gotoxy(35,22);
printf("input number 1-3:");
scanf("%d",&a) ;
switch (a)
{
case 1: preorder(&h); break;
case 2: inorder(&h); break;
case 3: postorder(&h) ; break;
}
getch();
}