its giving me this error or compile
1>project 4.obj : error LNK2019: unresolved external symbol "int __cdecl seqSearch(double * const,int,int)" (?seqSearch@@YAHQANHH@Z) referenced in function _main
// Ezaz Choudhry
//Project 3
// Reading Data From file in to array.
int size;
double max;
double min;
double sum;
int listLength = 10;
int searchItem1 = 10;
int loc1;
openfile(infile);
getData(infile,scores,size);
max = getMax(scores,size);
min = getMin( scores, size);
sum=calcsum(scores,size, min, max);
bubbleSort(scores,listLength);
cout << "The list contains the following items : ";
for (int i = 0; i < listLength; i++)
cout << scores[i] << " ";
cout << endl;
loc1= seqSearch(scores,listLength,searchItem1);
if (loc1 == -1)
cout << searchItem1 << " is not found in the list" << endl;
else
cout << searchItem1 << " is found at index " << loc1 << endl;
cout << "Enter the name of your input file : ";
cin >> InFileName;
infile.open(InFileName.c_str());
// Shows a Message if the file name is incorrect.
if (!infile)
{
cout << "I can't find your input file" << endl;
system("pause");
exit(-1);
}
}
// Gets Data From file and scores array.
void getData(ifstream &infile, double scores[] , int &size)
{
int i = 0;
do
{
infile >> scores[i];
i++;
} while (infile);
size = i - 1;
}
// Calculates the total of scores
double calcsum( const double scores[], int size, double min, double max)
{
double sum = 0;
for (int i = 0; i < size; i++)
sum += scores[i];
sum-= (min + max);
return sum ;
}
// finds the maximum
double getMax( const double scores[],int size)
{
double max = 0;
for (int i = 0; i < size; i++)
if (scores[i] > max)
max = scores[i];
return max;
}
//Finds the minimum
double getMin(const double scores[],int size)
{
double min = 99999;
for (int i = 0; i < size; i++)
if (scores[i] < min)
min = scores[i];
return min;
}
void bubbleSort(double scores[], int listLength)
{
int counter, index;
for (counter = 0; counter < listLength-1; counter++)
{
for (index = 0; index < listLength-1-counter; index++)
if (scores[index] > scores[index+1])
{
swap(scores[index], scores[index+1]);
}
}
}
int seqSearch(double scores[], int listLength, double searchItem)
{
int loc=0;
bool found = false;
while (loc < listLength && !found)
{
if (scores[loc] == searchItem)
found = true;
else
loc++;
}
return loc;
}
In two places you use different declarations: int seqSearch(double scores[], int listLength, int searchItem);
and int seqSearch(double scores[], int listLength, double searchItem)