Push and pop values and watch the C++ run one line at a time. Each value lives in its own Node on the heap. head points to the top of the stack, and tail points to the bottom node, whose next is nullptr.
The stack is empty. Both head and tail are nullptr, so there are no nodes to draw.
main()Unlike the array version, this stack never fills up: each push asks the heap for a new node. That is also why pop() must delete the old node, or the memory leaks.