高手看下,谢了
#include"stdio.h"#include"string.h"
#include"malloc.h"
#include"stdlib.h"
#define stack_init_size 100
int u=0,y=0;
typedef struct carinfo
{
char name[20];
}carinfo;
typedef struct stack
{
struct carinfo *base;
struct carinfo *top;
int stacksize;
}stack;
stack *s1,*s2,*s3,*s4,*s5,*s8,*s9;
carinfo *a,*b,*c;
void delet(stack *s8);
void initqueue(stack *s5);
void initstack(stack *s9);
void pushqueue(stack *s4,carinfo *c);
void push(stack *s3,carinfo *b);
int menu();
void main()
{
initstack(s1);
initqueue(s2);
int z;
z=menu();
switch(z)
{
case 1: push(s1,a); break;
case 2: delet(s1); break;
}
}
int menu()
{
printf("\t\t--------------------------------------------------");
printf("\t\t\t停车场管理系统");
printf("\t\t--------------------------------------------------");
printf("请输入您的选择");
printf("1.存放车辆");
printf("2.车辆出库");
int d;
scanf("%d",&d);
return d;
}
void push(stack *s3,carinfo *b)
{
if(s3->top-s3->base>=s3->stacksize)
{
printf("车位已满请等候......");
pushqueue(s3,b);
}
else
{
scanf("%s",b->name);
s3->top++;
s3->top->name=b->name;
y++;
//增加计费函数出示时间
printf("你的车位是%d",y);
}
}
void pushqueue(stack *s4,carinfo *c)
{
u++;
s4->top++;
scanf("%s",c->name);
s4->top->name=c->name;
printf("等待车位%d",u);
}
void initstack(stack *s9)
{
s9->base=(carinfo *)malloc(stack_init_size*sizeof(carinfo));
s9->top=s9->base;
s9->stacksize=stack_init_size;
}
void initqueue(stack *s5)
{
s5->base=(carinfo *)malloc(stack_init_size*sizeof(carinfo));
s5->top=s5->base;
s5->stacksize=stack_init_size;
}
void delet(stack *s8)
{
printf("请输入要出库的车辆牌照");
int k ,p;
stack *s7;
s7=s8;
char j[20];
scanf("%s",j);
for(k=1;;k++)
if(strcmp(j,s8->top->name)!=0) s8->top--;
if(k==1) s8->top--;
else for(p=k;p!=0;p--)
{
s7=s8;
s7->top=s8->top++;
}
//增加计费函数终止时间
printf("您的存车费用是");
}
D:\Program Files\Microsoft Visual Studio\新建文件夹\停车场.cpp(68) : error C2106: '=' : left operand must be l-value
D:\Program Files\Microsoft Visual Studio\新建文件夹\停车场.cpp(80) : error C2106: '=' : left operand must be l-value
执行 cl.exe 时出错.
停车场.obj - 1 error(s), 0 warning(s)
为什么出这样的错误!