Musisz sobie napisać własną funkcję porównującą dwie litery, tak jak to jest zrobione w przykładzie.
#include <iostream>
using namespace std;
bool LessThen( char letter1 , char letter2 )
{
bool is_small_letter1 { tolower(letter1) == letter1 };
bool is_small_letter2 { tolower(letter2) == letter2 };
if( tolower(letter1) == tolower(letter2) && !is_small_letter1 ) return false;
if( tolower(letter1) == tolower(letter2) && !is_small_letter2 ) return true;
return tolower(letter1)<tolower(letter2);
}
void selectionSort( string& data )
{
int min_index {0};
for( int i {0} ; i<data.size()-1 ; ++i )
{
min_index = i;
for( int j {i+1} ; j<data.size() ; ++j )
{
if( LessThen(data[j],data[min_index]) ) min_index = j;
}
swap(data[min_index],data[i]);
}
}
int main()
{
string data {"bAdfstRRdBaBbbBsAZkiopD"};
selectionSort( data );
cout << data << endl;
}