First off you should check if the given index is valid before entering the loop.
Now as for deleting something from an array, all you need to do is shift everything over one starting at the index to be deleted.
 is deleted, so everything past  is moved over to the left 1.
[NULL or 9 still*]
Since you can't really delete out of an array, you're still going to be left with the same number of elements. So if you delete one element, you can either set the last element to null or just leave it as is. Just depends on what you're doing.
Now I don't see you actually writing over anything in this function. So how do you expect anything to be deleted? I just see you decrement size a bunch of times which isn't even close to right.
if(idx >= size || idx < 0) return; //index out of bounds
if(idx == size - 1)
arr[idx] = null;
for(int i = idx; i < size - 1; i++)
arr[i] = arr[i+1];
I guess this wasn't your question?
|here i have to delete the whole location from the array|
That's not possible. Use a linked structure if you need this behavior.