[Solved] Confusion in stack pointer [closed]


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:

Stack push

Then You can pop these elements, but pop always removes the top one, like this:

enter image description here

If i misunderstood your question, please write a comment, and I will delete this post!

6

solved Confusion in stack pointer [closed]