I\'d like to do the following:
std::stack s; int h = 0; s.push(2); h = s.pop();
Such as to have h hold the value 2
h
You can use:
h = s.top();
then after that use(if you want to remove the most recent value otherwise do nothing)
s.pop();
It works the same way!!