vc6.0 编译C2059要怎么改 有些说没定义不知道怎么定义
#define N 5typedef struct QNode{
elemtype date;
struct QNode *next;
}QNode,*Queueptr;
typedef struct{
Queueptr front;
Queueptr rear;
}Linkqueue;
Linkqueue initqueue(Linkqueue Q){
Q.front = Q.rear = (Queueptr)malloc(sizeof(QNode));
if(! Q.front) printf("OVERFLOW");
Q.front->next=NULL;
return OK;
}
Linkqueue enqueue(Linkqueue Q,int x){
p=(Queueptr) malloc (sizeof(QNode));
if(!p) printf("OVERFLOW");
else{
p->date=x; p->next=NULL;
Q.rear->next=p;
Q.rear=p;}
return OK;
}
Linkqueue dequeue(Linklist Q){
int x;
if(Q.front==Q.rear) printf("ERROR");
else{
p=Q.front->next;
x=p->date;
Q.front->next=p->next;
}
else if(Q.rear==p) Q.rear=Q.front;
free(p);
return Ok;
}
int main(){
Linklist Q;
int i,x,y;
Q=initqueue(Q);
printf("please intput create date:\n");
for(i=1;i<=N;i++){
scanf("%d",&x);
Q=enqueue(Q,x);}
printf("\nthe queue is: \n");
for(i=1;i<=N;i++){
printf("%d",i);}
printf("\nplease input a insert date:\n");
scanf("%d",&y);
Q=enqueue(Q,y);
printf("\nthe queue after insert is:\n");
for(i=1;i<=N+1;i++){
printf("%d",i);}
Q=dequeue(Q);
printf("\nthe queue after delete is:\n");
for(i=1;i<=N;i++){
printf("%d",i);}
}