std::stack in C++ — a practical guide to C++ std::stack with clear examples you can reuse in real projects.
C++ Tutorial Series (85/111). Prefer one article? Read the complete C++ tutorial.
Short description
Default underlying container is deque.
stack
#include <stack>
std::stack<int> st;
st.push(1);
int top = st.top();
st.pop();