编译时出现的一个错误,请教一下
用c编的程序,编译的时候出现了三个提示一样的错误,lvalue required in function main 什么意思,估计应该在哪里修改,请各位高手指教,谢谢了
----------------解决方案--------------------------------------------------------
嗯把代码发出来看下撒,这样哪知道错在哪儿啊?
----------------解决方案--------------------------------------------------------
用*标记的句子就是报错的地方,三次报错一样
main()
{struct car{
int inf;
int num;
int time;
struct car *next;
};
int m,n=0,j=0,time1;
int max=3;
struct car *p1,*p2;
struct car *front,*rear;
struct car *top1,*base1;
struct car *top2,*base2;
p1=(struct car*)malloc(sizeof(struct car));
top1=base1=(struct car*)malloc(3*sizeof(struct car));
top2=base2=(struct car*)malloc(sizeof(struct car));
front=rear=(struct car*)malloc(sizeof(struct car));
printf("input the information of this car:");
scanf("%d",&p1->inf);
printf("input the number of this car:");
scanf("%d",&p1->num);
printf("input the time of this car:");
scanf("%d",&p1->time);
while(p1->inf!=00)
{while(p1->inf==01)
{if(top1-base1<(max*sizeof(struct car)))
{ ****top1++=p1;****
n++;
printf("the car stopped at the %dth of the stack",n);
}
else
{rear->next=p1;
rear=p1;
j++;
printf("the car stopped at the %dth of the quene",j);
}
p1=(struct car*)malloc(sizeof(struct car));
printf("input the information of this car:");
scanf("%d%d%d",&p1->inf,&p1->num,&p1->time);
}
while(p1->inf==10)
{while(p1->num!=(--top1)->num)
{
**** top2++=(--top1);*****
time1=p1->time-(--top1->time);
printf("the car has stopped %d minuters\n",time1);
printf("you should pay for %d*x yuan\n",time1);
}
while(top2!=base2)
top1++==(--top2);
while(front!=rear)
{ p2=front->next;
front->next=p2->next;
p2->time=p1->time;
***** top1++=p2;*******
if(rear==p2)
rear=front;
p1=(struct car*)malloc(sizeof(struct car));
printf("input the information of this car:");
scanf("%d%d%d",&p1->inf,&p1->num,&p1->time);
}
if(p1->inf==0)
break;
}
printf("thank you for using this system\n");
}
}的
----------------解决方案--------------------------------------------------------