I'm trying to make a template function specialization for a bubble sort of character array's. For some reason though, when I'm about to define the function, I get an error underline over the function name and I have no idea why.
template<typename T>
T sort(T* a, T n) {
int i, j;
int temp;
for (i = n - 1; i > 0; i--) {
for (j = 0; j < i; j++) {
if (a[j] > a[j + 1]) {
temp = a[j];
a[j] = a[j + 1];
a[j + 1] = temp;
}
}
}
}
template<>
const char* sort<const char*>(const char* a, const char* n) {
}