Detailed stack

Brief:

  stack is one stl container is essentially a stack structure, LIFO, no iterators, can only access the stack.

definition:

stack<int> st;

Member function:

(1) Capacity

st.empty (); sentenced to stack empty

The number of stack elements; st.size ()

(2) Operation

st.push (x); x-stack

• st.pop (); a stack element

(3) return information

• st.top (); the top element

 

 

 

Guess you like

Origin www.cnblogs.com/qq2210446939/p/12498661.html