基本的に私は、
double marks [STUDENTS][ASSIGNMENTS] = { (0.1,0.2,0.3,0.4,0.5,0.6,0.7),
(1,0.9,0.8,0.7,0.6,0.5,0.5),
(0.8,0.8,0.8,0.8,0.8,0.8,0.8),
(0.8,0.9,0.7,0.8,0.9,0.7,0.8),
(0.5,0.6,0.7,0.8,0.9,0.5,0.9)};
そして、私は取得したい:double studentAverages [STUDENTS]
からstudentAverages=calculateStudentAverages(marks);
使用:
double calculateStudentAverages (double marks[STUDENTS][ASSIGNMENTS]){
double averages[STUDENTS];
double average;
for (int i = 0; i < STUDENTS; i++) {
for (int j = 0; j < ASSIGNMENTS; j++) {
average = average + marks[i][j];
}
averages[i]=average/ASSIGNMENTS;
}
return averages;
}
しかし、「'double [5]' から 'double' に変換できません」および「'double' から 'double [5]' に変換できません」というメッセージが表示されます。