Well, you can't really remove a position from an array, what you can do is overwrite all the elements from that position to the end of the array with the one imediatelly on the right.
If you want to dynamically add/remove items, I would suggest that you use an STL list, deque, or vector. Then you can use the erase() and other member functions with impunity. Be aware when iterators are invalidated, though.
The advantage is that the STL is platform independent and quite efficient. It also eliminates quite a lot of the normal "housekeeping" code we end up having to do when we manage our own containers.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.