stack print STL c++ code example Example: print stack c++ Click to copywhile(!myStack.empty()) { cout << myStack.top() << " "; myStack.pop(); }