typedef char extra[20];
paixu(extra *name,extra *xuehao,int score[9999][4],int Number)
{
int i,j,k,change[9999][4];
char xuehao1[9999],name1[9999];
extra a,b;
for(i=1;i<Number;i++)
{
for(j=0;j<3;j++)
score[i][3]+=score[i][j];
}
for(i=0;i<Number-1;i++)
{
k=i;
for(j=i+1;j<Number;j++)
{
if(score[k][3]<score[j][3])
k=j;
else if(score[k][3]==score[j][3])
{
if(xuehao+k>xuehao+i)
k=j;
}
}
if(k!=i)
{
memcpy(change[i],score[i],4*sizeof(int));
memcpy(score[i],score[k],4*sizeof(int));
memcpy(score[k],change[i],4*sizeof(int));
a=*(xuehao+i); //error C2106: '=' : left operand must be l-value
*(xuehao+i)=*(xuehao+k); //error C2106: '=' : left operand must be l-value
*(xuehao+k)=a; //error C2106: '=' : left operand must be l-value
b=*(name+i); //error C2106: '=' : left operand must be l-value
*(name+i)=*(name+k); //error C2106: '=' : left operand must be l-value
*(name+k)=b; //error C2106: '=' : left operand must be l-value
}
}
我就发了其中一个函数,这个函数目的是把总成绩排序。最上面一行是说明一下extra函数怎么来的,怕看不懂,我想问我标注的问题怎么解决。
胡说叔叔
相关分类