stack c++ how to print it code example Example: print stack c++ while(!myStack.empty()) { cout << myStack.top() << " "; myStack.pop(); }