Hi to all, I am new to this C++ world

I have kind of a quick question. I need to do a modified selection sort that can handle characters. I know how to do one but only with integers (see code below). Any help or suggestion as to how I should go about it is greatly appriciated. : )
//function selection_sort...

void selection_sort (int array[], int elements)
{	
	int start_scan, my_index, my_value;
	
	for (start_scan = 0; start_scan < (elements - 1); start_scan++)
	{
		my_index = start_scan; 
		my_value = array[start_scan];

		for (int index = start_scan + 1; index < elements; index++)
		{

			if (array[index] < my_value)
			{
				my_value = array[index];
				my_index = index;
			}
		}	
		array[my_index] = array[start_scan];  //swap the elements
		array[start_scan] = my_value;
	}		
}

Just replace int array[] with std::string array[] and int my_value with std::string my_value , the rest of that will not change.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.