求助!!请大佬帮忙!!还是cannot convert parameter 1 from 'char' to 'char *'这个小问题1
#include "Score_System2018.h"void sort(int n[N],char name[N][10],float eng[N],float mathe[N], float cp[N],float total[N],float aver[N],float gpa[N])
{int i,j,nu;float p,en,ma,cpp,av,gp;char na[10];
printf("学号\t姓名\t英语\t高数\tC程序\t总分\t平均分\t绩点\n");
for(j=0;j<N-1;j++)
for(i=0;i<N-1-j;i++)
if(total[i]<total[i+1])
{p=total[i+1];total[i+1]=total[i];total[i]=p;
nu=n[i+1];n[i+1]=n[i];n[i]=nu;
strcpy(na[10],name[i+1]);strcpy(name[i+1],name[i]);strcpy(name[i],na[10]);
en=eng[i+1];eng[i+1]=eng[i];eng[i]=en;
ma=mathe[i+1];mathe[i+1]=mathe[i];mathe[i]=ma;
cpp=cp[i+1];cp[i+1]=cp[i];cp[i]=cpp;
av=aver[i+1];aver[i+1]=aver[i];aver[i]=av;
gp=gpa[i+1];gpa[i+1]=gpa[i];gpa[i]=gp;
}
for(i=0;i<N;i++)
{
printf("%d\t",n[i]);
printf("%s\t",name[i]);
printf("%4.1f\t",eng[i]);
printf("%4.1f\t",mathe[i]);
printf("%4.1f\t",cp[i]);
printf("%4.1f\t",total[i]);
printf("%4.1f\t",aver[i]);
printf("%4.1f\n",gpa[i]);
}
}
以上是我的一个子程序,它的错误如下;
课程设计\sort.cpp(10) : error C2664: 'strcpy' : cannot convert parameter 1 from 'char' to 'char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
课程设计\sort.cpp(10) : error C2664: 'strcpy' : cannot convert parameter 2 from 'char' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.
sort.obj - 2 error(s), 0 warning(s)
求教啊!大佬们,这是作业时间不多了欸。。。谢谢大佬们的帮忙!!!谢谢!!