1>测试.cpp(243): error C2106: “=”: 左操作数必须为左值
voidDeleteInformation(){system("cls");intm=load();inti,j,n,t,flag;charnum[10];printf(...
void DeleteInformation()
{
system("cls");
int m=load();
int i,j,n,t,flag;
char num[10];
printf("\n 原来的职工信息:\n");
chakan();
printf("\n");
printf("请输入要删除的职工的工号:\n");
scanf("%s",num);
for(flag=1,i=0;flag&&i<m;i++)
{
if(strcmp(stu[i].EmployeeNum,num)==0)
{
printf("\n已找到此人,原始记录为:\n");
printf("职工号\t姓名\t性别\t年龄\t工作\t住址\t电话\t\t入职时间");
printf("\n %s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n",stu[i].EmployeeNum,stu[i].EmployeeName,stu[i].EmployeeGender,stu[i].EmployeeAge,stu[i].EmployeeWork,stu[i].EmployeeAddness,stu[i].EmployeeTelephone,stu[i].EmployeeTime);
printf("\n确定要删除此人信息请按1,不删除请按0\n");
scanf("%d",&n);
if(n==1)
{
for(j=i;j<m-1;j++)
{
strcpy(stu[j].EmployeeName,stu[j+1].EmployeeName);
stu[j].EmployeeNum=stu[j+1].EmployeeNum;
strcpy(stu[j].EmployeeGender,stu[j+1].EmployeeGender);
strcpy(stu[j].EmployeeAge,stu[j+1].EmployeeAge);
strcpy(stu[j].EmployeeWork,stu[j+1].EmployeeWork);
strcpy(stu[j].EmployeeAddness,stu[j+1].EmployeeAddness);
strcpy(stu[j].EmployeeTelephone,stu[j+1].EmployeeTelephone);
strcpy(stu[j].EmployeeTime,stu[j+1].EmployeeTime);
}
flag=0;
}
}
}
if(flag==0)
{
m=m-1;
}
else
{
printf("\n对不起,查无此人!\n");
}
printf("\n 浏览删除后的所有职工信息:\n");
save(m);
chakan();
printf("\n继续使用删除请按1,不再使用请按0\n");
scanf("%d",&t);
switch(t)
{
case 1:
DeleteInformation();
break;
case 0:
break;
default :
break;
}
} 展开
{
system("cls");
int m=load();
int i,j,n,t,flag;
char num[10];
printf("\n 原来的职工信息:\n");
chakan();
printf("\n");
printf("请输入要删除的职工的工号:\n");
scanf("%s",num);
for(flag=1,i=0;flag&&i<m;i++)
{
if(strcmp(stu[i].EmployeeNum,num)==0)
{
printf("\n已找到此人,原始记录为:\n");
printf("职工号\t姓名\t性别\t年龄\t工作\t住址\t电话\t\t入职时间");
printf("\n %s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n",stu[i].EmployeeNum,stu[i].EmployeeName,stu[i].EmployeeGender,stu[i].EmployeeAge,stu[i].EmployeeWork,stu[i].EmployeeAddness,stu[i].EmployeeTelephone,stu[i].EmployeeTime);
printf("\n确定要删除此人信息请按1,不删除请按0\n");
scanf("%d",&n);
if(n==1)
{
for(j=i;j<m-1;j++)
{
strcpy(stu[j].EmployeeName,stu[j+1].EmployeeName);
stu[j].EmployeeNum=stu[j+1].EmployeeNum;
strcpy(stu[j].EmployeeGender,stu[j+1].EmployeeGender);
strcpy(stu[j].EmployeeAge,stu[j+1].EmployeeAge);
strcpy(stu[j].EmployeeWork,stu[j+1].EmployeeWork);
strcpy(stu[j].EmployeeAddness,stu[j+1].EmployeeAddness);
strcpy(stu[j].EmployeeTelephone,stu[j+1].EmployeeTelephone);
strcpy(stu[j].EmployeeTime,stu[j+1].EmployeeTime);
}
flag=0;
}
}
}
if(flag==0)
{
m=m-1;
}
else
{
printf("\n对不起,查无此人!\n");
}
printf("\n 浏览删除后的所有职工信息:\n");
save(m);
chakan();
printf("\n继续使用删除请按1,不再使用请按0\n");
scanf("%d",&t);
switch(t)
{
case 1:
DeleteInformation();
break;
case 0:
break;
default :
break;
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询