我有一些麻煩。程序工作,然後當我分裂成每個功能我得到這些錯誤:林得到以下錯誤,我不知道它是什麼意思:錯誤錯誤LNK2019
錯誤1錯誤LNK2019:無法解析的外部符號「int __cdecl calcAVE(int * const,int)」(?calcAVE @@ YAHQAHH @ Z)引用在函數_main c:\ Users \ Joshua \ documents \ visual studio 2013 \ Projects \ ConsoleApplication10 \ ConsoleApplication10 \ Source.obj ConsoleApplication10
請幫助,謝謝。
#include <iostream>
using namespace std;
void getUserInput(int [], int&);
int calcAVE(int [], int);
void outPute(int [], int, int);
int main()
{
int theAverage = 0;
int ct = 0;
const int MAX_SIZE = 100;
int theArray[MAX_SIZE];
getUserInput(theArray, ct);
theAverage = calcAVE(theArray, ct);
outPute(theArray, ct, theAverage);
return 0;
}
void getUserInput(int theArray[], int& ct)
{
int quit = 0;
int theNums = 0;
int i = 0;
while (true)
{
cout << "please enter numbers, enter 0 to quit \n";
cin >> theNums;enter code here
if (theNums == quit)
{
break;
}
theArray[ct] = theNums;
ct++;
}
}
int calcAve(int theArray[], int ct)
{
int i = 0;
int total = 0;
int average = 0;
for (i = 0; i < ct; i++)
{
total += theArray[i];
average = total/ct;
}
return average;
}
void Output(int theArray [], int ct, int average)
{
int i = 0;
for (i = 0; i < ct; i++)
{
if (theArray[i] > average)
{
cout << theArray[i] << ", ";
}
}
}
錯字:'outPute'與'輸出' –