2014-12-09 4 views
0

에 호환되지 않습니다. 따라서 8 번째 줄에 문제가 있습니다. "인수 유형 int가 매개 변수 유형 int와 호환되지 않습니다"라는 오류 메시지가 나타납니다. 나는 오류의 의미를 이해하지 못한다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?오류 : 인수 유형 int가 매개 변수 유형

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; 
} 
+0

당신이 쓰고있는 언어와 버전을 분명히하고 싶을 수도 있습니다. –

+1

점수가 int 인 것처럼 보이지만 perfectScore의 인수는 int [] 또는 int * – ryanyuyu

+0

입니다. C++을 사용하고 있습니다. 버전별로 무엇을 의미합니까? – sylvanna

답변

0

실제로 int 배열을 허용하는 함수에 int를 제공하고 있습니다.

+0

답변을 완료 할 수 있습니까? 그것이 그렇듯이, 당신이 가리키고있는 곳이 정확히 불분명합니다. –

0

함수가 int 대신 int 배열을 필요로합니다.

+0

그게 무슨 뜻이야? 매개 변수를 어떻게 변경해야합니까? @admnc – sylvanna