Hi all, I'm taking an intro to c++ class and our assignment is to type up this example (
https://books.google.com/books?id=et8hDgAAQBAJ&pg=PA610&lpg=PA610&dq=chapter+8+example+8+ds+malik+arrays+help&source=bl&ots=4TnvETXE8l&sig=qVAg7LUs-dre69ps_cqEHJgDkDg&hl=en&sa=X&ved=0ahUKEwiH0drYo_DTAhVCImMKHc_zB28Q6AEIRzAF#v=onepage&q&f=false page 546) and get it to run. I've typed it up, checking it several times, but I keep getting an error that says "undefined reference to 'seqSearch(int const*, int, int)'. I've read through the chapter and done some research online but I'm still unsure of how to solve this... Thanks for any help you can give!
//preprocessor directives/header functions
#include <iostream>
//standard library
using namespace std;
const int ARRAY_SIZE = 10;
int seqSearch(const int list[], int listLength, int searchItem);
//enter function main
int main()
{
int intList[ARRAY_SIZE];
int number;
cout << "Enter" << ARRAY_SIZE << " integers." << endl;
//reads data into intList array
for (int index = 0; index < ARRAY_SIZE; index++)
cin >> intList[index];
cout << endl;
cout << "Enter the number to be searched";
cin >> number;
cout << endl;
int pos = seqSearch(intList, ARRAY_SIZE, number);
if (pos != -1)
cout << number << "is found at index " << pos << endl;
else
cout << number << "is not found at index" << endl;
return 0;
}