Answer the question
In order to leave comments, you need to log in
Why is data not being added to the stack (STL)?
When executing the code, data is not added to sorted, I look with a debugger.
#include <stack>
using namespace std;
int main() {
stack<int> source;
stack<int> sorted;
source.push(17);
source.push(11);
source.push(1);
source.push(9);
while(!source.empty())
{
sorted.push(10);
source.pop();
}
return 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question