how to empty stack in c++ code example
Example 1: check an stack is empty c++
std::stack <int> st;
if(st.empty())
std::cout << "stack is empty";
Example 2: size of stack in c++
std::stack<int> st;
std::cout << "size of stack: " << st.size();
std::stack <int> st;
if(st.empty())
std::cout << "stack is empty";
std::stack<int> st;
std::cout << "size of stack: " << st.size();