What I currently have is:
std::vector<char> test = {'a', 'f', 'b', 'g', 'c', 'K', 'E'};
int smallest;
for ( int i = 0; i < test.size() - 1; i++)
{
smallest = i;
for (int j = i + 1; j < test.size(); j++ )
{
if (test[j] < test[smallest])
smallest = j;
}
int temp = test[smallest];
test[smallest] = test[i];
test[i] = temp;
}
Which sorts vector test as: {E,K,a,b,c,f,g}. However, I want to treat uppercase and lowercase letters as equals so the end result instead is: {a,b,c,E,f,g,K}. What would be best way to achieve this? I guess one way would be to reset all the values of either the capital or lowercase letters to equal each other.