Hello, I am learning on arrays and I have to learn how to delete an element(s) from an array; suppose I have an array x[10] = {1,2,3,4,5,6,7,8,9,10}, and I want to delete array{5} so that the values of the array become {1,2,3,4,5,7,8,9,10}; how do I go about this?
This is not the same as setting the value of array{5} to null; but completely eliminating it so that it does not get printed alongside the other elements of the screen. Somebody, please help out, thanks.
Thanks kbw, for your prompt response, but there has to be some sort of manipulation; that allows the user to shift all the elements of the array to the left and then removing the last element in the array; my teacher said so; and he said to find it :)
There is, but as you can't resize an array, the best you can do is move it to the end. With a vector, the final step would be to reduce it's size to remove the end element(s).