stack display in c++ code example
Example: show stack c++
void showstack(stack<int> s) {
while(!s.empty()) {
cout<< s.top()<<" ";
s.pop();
}
cout<<endl;
}
void showstack(stack<int> s) {
while(!s.empty()) {
cout<< s.top()<<" ";
s.pop();
}
cout<<endl;
}