This program is supposed to find the largest number, then cout the index it's found in an array, along with the unsorted array. We can use a sorted array when we sort, then cout the unsorted array.
The search doesn't match on the first comparison in the if statement. copyarrray[19] (or 92) != arrray[0] (or 83). So the function goes to the else statement which terminates the function call with a return -1. It's not going to go to the next iteration of the for loop.
1 2 3 4
if (copyarrray[19] == arrray[index])
return index;
elsereturn -1;
Why does void sort() have a return floating in it?
Okay, but what is causing it to stop displaying anything after displaying the filled, unsorted array?
You call display only at the end, so it's only displaying the array at the end of everything. If the array it displays is unsorted, your sort function is not working.