Problem with sort

I cant seem to figure out why my sort isnt working, its fine until it actually swops an element then its comparing the wrong elements, any suggestions?

1
2
3
4
5
6
7
8
9
10
11
12
13

	for (int index = 0; index < numItems - 1; index ++)
	{
		for (int index2 = index + 1; index2 < numItems; index2 ++)
		{
			if (_stricmp(itemArray[index]->GetSortValue(), itemArray[index2]->GetSortValue()) > 0)
			{
				ItemType* tempItem = itemArray[index2];
				itemArray[index2] = itemArray[index];
				itemArray[index] = itemArray[index2];
			}
		}
	}


numItems is the ammount of items read into the array

happy to provide any more info needed
If line 10 is correct, then what is the point of line 8?
Topic archived. No new replies allowed.