How to direct access to the elements of stack in C++?
<p>For some reason, I have to use a stack to achieve some function, but I need to reverse the output stack's elements. So I want to use <code>stack&lt;char,vector&lt;char&gt;</code> to achieve direct access, but there may be some error in my suggestion. Can anyone tell me how to efficiently reverse the output stack's elements in C++ using STL stack?</p>
