Getting A Linker Error Please Help!

I am trying to write a program that will dynamically allocate an array based on how many students are taking a survey. Our instructor is only allowing us to use pointer notation for the arrays (with the exception of the "new" and "delete" commands).

Here is what I have so far:

#include <iostream>
using namespace std;

void selection_sort(int *, int);

int main()
{
int *movieData;
int SIZE;

cout << "This program asks for the number of students who participated\n"
<< "in a movie survey, and then asks for the number of movies each\n"
<< "student saw in a given month. The program will then compute\n"
<< "the mean, median, and mode of the data entered.\n\n";

cout << "Please enter how many students participated in the survey: ";
cin >> SIZE;

while(SIZE < 0)
{
cout << "Negative numbers are not allowed.\n"
<< "Please enter how many students participated in the survey: ";
cin >> SIZE;
}

movieData = new int[SIZE];

for(int x = 0; x < SIZE; x++)
{
cout << "Please enter number of movies seen by student "
<< x + 1 << ": ";
cin >> *(movieData + x);

while(*(movieData + x) < 0)
{
cout << "Negative numbers are not allowed.\n";
cout << "Please enter number of movies seen by student "
<< x + 1 << ": ";
cin >> *(movieData + x);
}
}

for(int x = 0; x < SIZE; x++)
{
cout << *(movieData + x) << " ";
}

cout << endl;

selection_sort(movieData, SIZE);

for(int x = 0; x < SIZE; x++)
{
cout << *(movieData + x) << " ";
}

cout << endl;

system("PAUSE");
return 0;
}

void selection_sort(int *movieData[], int SIZE)
{
int startScan, minIndex;
int *minElem;

for(startScan = 0; startScan < (SIZE - 1); startScan++)
{
minIndex = startScan;
minElem = *(movieData + startScan);

for(int index = startScan + 1; index < SIZE; index++)
{
if(*(*(movieData + index)) < *minElem)
{
minElem = *(movieData + index);
minIndex = index;
}
}

*(movieData + minIndex) = *(movieData + startScan);
*(movieData + startScan) = minElem;
}
}

I am getting a linker error that says "undefined reference to 'selection_sort(int*, int)" Id returned 1 exit status.

There are no other errors in my program, and I don't know how to fix the linker error. Please help!
Topic archived. No new replies allowed.