Quote (YCX @ Nov 14 2017 02:43pm)
Instead of dropping the first 30%, how about showing only the integers after that, up to the end of the entered integers?
e.g. User enters 1, 2, 3, 8, 7, 6, 5, 4, 9, 0
Sort: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...]
Display, starting at index 3 up to index 9: 3, 4, 5, 6, 7, 8, 9
Ah well the array is limited to 50 but the user can can choose to input any number of values 1-50 if they choose. So I Wouldnt be able to just not display the first 15.
But one other issue is that these integers that the user enters are calculated after I sort out the bottom 30%. They are grades for quizzes. So after I sort this array I have to use it to calculate the gpa for the top 70%. If I choose it to display these then they would still be calculated in the gpa since they still exist in the array.
Quote (spaceleak @ Nov 14 2017 04:22pm)
Are you using a raw array? Do you have to? A STL container would be more suitable.
You can't dynamically resize an existing raw array in C++, so if you have to use a raw array you will pretty much have to do what YCX suggests and display a range of indexes or copy that range of indexes to a new array to simulate "dropping".
Yeah it has to be that type of an array. Ok copying The range to a new array is a good idea.
Thanks for the ideas I'm going to mess around with both