C++ sort array of strings
- by user69514
I am trying to sort an array of strings, but it's not sorting anything.... what am I doing wrong?
string namesS[MAX_NAMES];
int compare (const void * a, const void * b){
return ( *(char*)a - *(char*)b );
}
void sortNames(){
qsort(namesS, MAX_NAMES, sizeof(string), compare);
}