结构体中的字符比较大小后怎么将他们相互复制的啊帮忙解答下啊!要指出方法的哦
struct stu{int xuehao;char mingzi[20];char sex[20];int age;int chengji;char xueyuan[20];};stu s[3]={{0501,"李明","男",19,610,"信院"},{0502,"张莉","女",19,599,"信院"},{0503,"王涛","男",20,580,"控制"}};
void zuhe(stu s[])
{
char t;
for(int b=0;b<=2;b++)
for(int c=b+1;c<=2;c++)
{
if(strcmp(s[b].sex,s[c].sex)<0)
{
strcpy(t,s[b]);
strcpy(s[b]=s[c]);
strcpy(s[c]=t);
}
}
}