char str[]="BCAbca";
auto cmp = [](char a, char b)
{
auto upper = [](char c)
{
return ( c >= 'A'&&c <= 'Z' );
};
auto lower = [](char c)
{
return ( c >= 'a'&&c <= 'z' );
};
if (upper(a))
{
if (upper(b))
return a < b;
else
return a<b-32;
}
else
{
if (upper(b))
return a-32<b;
else
return a < b;
}
};
std::sort(str, str+6, cmp);
Convert lowercase to uppercase and compare
I don’t know what the mentality of people who dislike this answer~
Example of C language
Effect:

One idea is similar to converting a into a number between AB, that is, asc code + 0.5
Convert characters to numbers, the example is as follows:
Probably like this:
Compare char c1 and c2:
It is recommended to learn C++.