title: How can I print out the contents of std::stack and return its size?
body: <p>In c++ how can I print out the contents of my stack and return its size?</p>
  
  <pre><code>std::stack&lt;int&gt;  values;
  values.push(1);
  values.push(2);
  values.push(3);
  
  // How do I print the stack?
  </code></pre>