|I need to delete an index from the array, but mine is deleting a number rather than an array.|
OK, you're mangling the language here so badly that I can't really tell what you want to do.
Firstly, what do you mean by "delete an index"? The index is the number by which you access a given element. In the code you've posted, your elements are numbers, so deleting an element means deleting one of the numbers from your array.
And they you talk about deleting "an array", as if you want to delete the entire array. Do you mean that you want to clear all the elements from the array?
You also haven't shown us the definition of array
in your code. Is it a C-style array, or a std::array
? Is it a local variable, a global one, or is it dynamically allocated on the heap?
Please can you be more precise about exactly what you want the behaviour of your program to be, and how the behaviour you're actually seeing differs from what you want.
EDIT: Is this a duplicate of http://www.cplusplus.com/forum/beginner/223804/
? Or are you asking something different?