|
You could create a typedef for the arraytype:
#typedef ARRAYTYPE double
or
#typedef ARRAYTYPE int
Then use arraytype instead of int or double:
void sSort(ARRAYTYPE x[], int n){...}
Since this is C++, you could also duplicate sSort() to create one that sorts integers:
void sSort(int x[], int n){...}
You can leave both versions of sSort() in your program. as C++ will treat them as separate functions since their input parameters are different.
|