check an stack is empty c++ code example Example: check an stack is empty c++ std::stack st; if(st.empty()) std::cout << "stack is empty";