Delete only first element of array
arrays, c++, delete-operator
Solution
Use a deque to remove an element from the front — that's what this structure is invented for.
Problem
Is it possible to do something like this: ``` int *iarray = new int[10]; ..... //do something with it ..... ``` and then in order to easily remove first element do this: ``` delete iarray; iarray++; ``` it seems that delete (without [] ) still deletes whole array. If it's possible it would be really tricky and clever way to remove first element. The idea is not mine, I saw it somewhere, but it's doesn't work with me. Am I doing something wrong?