String array selection sort

So I am writing a program that will sort a string array alphabetically. I have the selection sort done.
Where I am hitting a brick wall is how to sort it alphabetically regardless if its a capital letter or not, with out actually changing the word in the array.

so an example is the user inputs Zucchini, almonds, bread
and the program outputs almonds, bread, Zucchini

I tried to make a function that would temp convert toupper however that does not work out so well if at all.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#include <stdio.h>
#include <ctype.h>
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>

using namespace std;
int help(string one, string two);
void selectionSort(string array[], int size)
{

   int start; 
   string temp;
   for(int i = size -1; i > 0; --i)
   {
      start = 0;
      for(int j = 1; j <= i; ++j)
      {
	 if(array[j] >array[start])
	 {
	    start = j;
	 }
	 temp = array[start];
	 array[start] = array[i];
	 array[i] = temp;
      }
   }
   for(int k = 0; k < size; k++)
   {
      cout << array[k] << endl;
   }

}

int help(string one, string two)
{
   char a;
   for(int i = 0; i < one.length(); i++)
   {
      a = one.at(i);
      putchar (toupper(a));
      two.at(i) = a;
   }
   char b;
   for(int i = 0; i < two.length(); i++)
   {
      b = two.at(i);
      putchar (toupper(b));
      two.at(i) = b;
   }
   if(one.compare(two) > 0)
   {
      cout << one << endl;
      return 1;
   }
   else
   {
      cout << two << endl;
      return 0;
   }

}
int main()
{
   int Size;

   cout << " how many strings will you enter ";
   cin >> Size;
   string input[Size];

   for(int i =0; i < Size; i++)
   {
      cout << " enter the String ";
      cin >> input[i];
   }
   selectionSort(input, Size);

   return 0;
}
Topic archived. No new replies allowed.