You can't. You can overwrite items in an array, but you can't remove them.
Say you have an array {10, 5, 0, 3, 6, 9} and you wish to delete the 3rd item (i = 2; item = 0).
Since we can't delete, we'll need to write the items [i+1, n] to [i, n-1]:
1 2 3 4
for (i = 2; i < n; ++i) {
myArray[i] = myArray[i+1];
}
myArray[n--] = 0;
This way, every array spot is overwritten with the value in the next spot. Then, the last number in the array (which no longer exists, but still holds its old value) is set to 0 (or any other number) and 'n' (the number of elements) is reduced by one.
Not sure what you mean, but I'm interpreting your question as "I have an int array and I want to remove all elements with value X". e.g. the array {0, 8, 4, 6, 3, 2, 1, 8} and you want it without the values '8'.
The easiest way is to loop and keep two counters: one for the current element ('i'), one for the amount of X's found (i.e. deleted elements) ('c'). Then, check each element of your array. If it equals X, skip it and increase your counter by one. If it doesn't equal X, copy it to array[i-c]. By the end, you'll have your array without X's.
This method works without a temporary array, so no need for copying or anything.
if you have an array but do not know which array the information is stored how do find that information in the array the delete it
Asin, how do you find an element in an array, or you have a number of different arrays and want to find something that might be an element of any of them?