[英]ERROR: argument type int incompatible for parameter type
so I'm having issues with line 8. I am getting an error message saying " argument type int is incompatible with parameter type int". 所以我在第8行遇到了问题。我收到一条错误消息,提示“参数类型int与参数类型int不兼容”。 I'm not understanding what the error is saying.
我不明白错误在说什么。 What am I doing wrong?
我究竟做错了什么?
const int NUM_TEST = 5;
int perfectScore(int score[]);
int main()
{
int score ;
double enteredScore[] = {0.00};
int location = 1;
location = perfectScore(score);
cout << "This program will allow you to enter up to 5 scores and will then report how many test scores are entered.\n" << endl;
int perfectScore(int score[]);
for (int i = 0; i<=NUM_TEST; i++) {
cout << "Enter a test score in the range 0 to 100: ";
cin >> i;
}
if(score != 100)
{
cout << "The 5 test scores you entered included " << enteredScore[score] << "perfect scores" << endl;
}
system("pause");
return 0;
}
int perfectScore(int score[])
{
int countPerfect = -1;
for(int i = 0; i < NUM_TEST; i++)
{
if(score[i]==100)
{
countPerfect =1;
}
}
return countPerfect;
}
您将int赋予实际上接受int数组的函数。
您的函数需要一个int数组,而不是一个int数组。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.