Update: I have 3 files - prog6.cpp, sorts.cpp, and sorts.h. sorts.h is:
Code:
#include <stdexcept>
void selectSort(int array[], int first, int last) throw (std::range_error);
void bubbleSort(int array[], int first, int last) throw (std::range_error);
void quickSort(int array[], int first, int last) throw (std::range_error);
prog6.cpp and sorts.cpp include "sorts.h". sorts.cpp is not a class, just those 3 methods listed above. My question is how do I call any one of those 3 methods in sorts.cpp from prog6.cpp? I tried just writing "selectSort(myArray, 0, 20);" in prog6.cpp but I get the error:
Code:
[Linker error] undefined reference to `selectSort(int*, int, int)'
ld returned 1 exit status
Makefile.win [Build Error] [sortz.exe] Error 1
Code:
else if(*argv[typeIndex] == 's')
{
cout << "Selection sort:\n";
selectSort(array, 0, count);
}