working on an ptr program for class
I've gotten an error that I'm not sure how to fix.
lnk2019 unresolved external symbol void__cdecl.
these are the two areas the error talks about
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
int main()
{
int avg;
int size;
int mode;
double average;
double mean;
const int POSSIBLE_NUMBERS = 999;
cout << "Please enter how big you want the array\n";
cin >> size;
int *arrayPtr = new int[size];
for (int count = 0; count < size; count++)
{
arrayPtr[count] = (rand() % POSSIBLE_NUMBERS);
}
average = getAverage(arrayPtr, size);
cout << "The average is " << average << endl;
arrSelectionSort(arrayPtr, size);
return 0;
}
void arrSelectionSort(int *arr[], int size)
{
int startScan, minIndex;
int *minElem;
const int ONE = 1;
const int ZERO = 0;
for (startScan = ZERO; startScan < (size - ONE); startScan++)
{
minIndex = startScan;
minElem = arr[startScan];
for (int index = startScan + ONE; index < size; index++)
{
if (*(arr[index]) < *minElem)
{
minElem = arr[index];
minIndex = index;
}
}
arr[minIndex] = arr[startScan];
arr[startScan] = minElem;
}
}
|
Last edited on
Topic archived. No new replies allowed.