In my program assignment, I have to write a template sort routine using insertion sort algorithm. Then I have to test using array of primitives, and an array of a type I create. I have finished my code, and it works correctly with arrays of primitive types, but I'm not exactly sure what it means to have an array of a type you create. Can anyone help me out here??
SomeClass arr[20];
//Initialize arr
InsertionSort(arr, arr + 20);//Or however you call your routine
You should create Some class and make sure that it have proper copy constructor, assigment operator, defined comparsion function (for default sorting it is usually <) and whichever requirement your function places on passed types.