This is how a stack works:
You push elements into it like this. The freshly added elements are always “on top” since it is a Last in First Out (LIFO) structure. You can only access the top element:
Then You can pop these elements, but pop always removes the top one, like this:
If i misunderstood your question, please write a comment, and I will delete this post!
6
solved Confusion in stack pointer [closed]