When implementing the stack, you should click and place it at the end of the array, not at the beginning. Thus, nothing should move. In fact, if your elements do not need to be cleared (without pointers, etc.), then the pop file is as simple as decreasing the top stack variable.
source
share