C语言结构体数组函数调用问题
直接上程序,找不出错误了,哪位大神给看看啊#include<stdio.h>structstudents{intno;charname[7];intscore;};str...
直接上程序,找不出错误了,哪位大神给看看啊
#include<stdio.h>
struct students{
int no;
char name[7];
int score;
};
struct students maxScore(struct students s[], int len)
{
int i = 0,maxScore = 0,j;
len = sizeof(s)/sizeof(s[0]);
for (i = 0; i<len; ++i){
if(maxScore<s[i].score){
maxScore = s[i].score;
j = i ;
}
}
return s[j];
} 展开
#include<stdio.h>
struct students{
int no;
char name[7];
int score;
};
struct students maxScore(struct students s[], int len)
{
int i = 0,maxScore = 0,j;
len = sizeof(s)/sizeof(s[0]);
for (i = 0; i<len; ++i){
if(maxScore<s[i].score){
maxScore = s[i].score;
j = i ;
}
}
return s[j];
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询