主题:请专家们帮我看看
#include "stdio.h"
#include "stdlib.h"
typedef struct Qnode{
int data;
struct Qnode *next;
}Qnode,*queueptr;
typedef struct{
queueptr front;
queueptr rear;
}linkqueue;
linkqueue q;
void creatqueue();
{
printf("jian li kong lian biao:\n");
q.front=q.rear=(queueptr)malloc(sizeof(Qnode));
q.front->next=NULL;
}
void insert()
{
int e;queueptr p;
printf("insert letter:");
scanf("%d",&e);
p=(queueptr)malloc(sizeof(Qnode));
p->next=NULL;
p->data=e;
q.rear->next=p;
q.rear=p;
}
void delet()
{ printf("shan chu lian biao zhong jin you de yuan su");
queueptr p;
p=q.front->next ;
q.front->next=p->next;
free(p);
}
void display()
{ queueptr p;
p=q.front->next;
while(p!=NULL)
{printf("\n输出练队列:\n");
printf("%d",p->data);
p=p->next;}
}
void main()
{
int i,j;
while(j)
{
printf("\n 1--- creatqueue ");
printf("\n 2---insert ");
printf("\n 3--- delet ");
printf("\n 4---exit ");
printf("\n请选择(0---4):");
scanf("%d",&i);
if(i==1)
{
creatqueue();
display();
}
else if(i==2)
{insert();
display();
}
else if(i==3)
{
delet();
display();
}
else if(i==4)
{
j=0;
printf("\n exit \n");
}
}
不知错误在哪儿,很郁闷啊~~~