编译程序 出现了error c2106的 错误不知道如何改求大神指点,,,,
我想把信息输入到结构体变量当中去 ,然后按照学号由小到大输出出来,想先编一个样本出来但是遇到这个问题,#include<stdio.h>
#include<math.h>
#include<malloc.h>
#include<string.h>
#define N 3
struct student
{ char number[20], name[20];
int score[3];
};
void main()
{
int i=0,j,k;
struct student exchange ;
struct student *student;
student=(struct student*)malloc(100*sizeof(struct student));
struct student a[N]={
{"27","赵滨",522},
{"12","王子豪",522},
{"3","尚晓琼",522}
};
for(k=i;k>0;k--)
for(j=i;j>i-k;j--)
{
if(strcmp(a[j].number,a[j-1].number)>0)
{strcpy(exchange.name,a[j].name);
strcpy(a[j].name,a[j-1].name);
strcpy(a[j-1].name,exchange.name);
exchange.number=a[j-1].number;
a[j-1].number=a[j].number;
a[j].number=exchange.number;D:\新建文件夹\Microsoft Visual Studio\MyProjects\学生情况表\情况表.cpp(28) : error C2106: '=' : left operand must be l-value
D:\新建文件夹\Microsoft Visual Studio\MyProjects\学生情况表\情况表.cpp(29) : error C2106: '=' : left operand must be l-value
D:\新建文件夹\Microsoft Visual Studio\MyProjects\学生情况表\情况表.cpp(30) : error C2106: '=' : left operand must be l-value