P
pentiumPunk
string something;
while(condition)
{
cin>> something;
node<T> *x;
x = new node<T> (something);
aStack.push(x);
}
i want to keep adding "something" to a stack, and top( ) and pop( ) it off,
but the problem is...... x is being overridden each time. how am i going to
manage the nodes in the stack ? thanks!
while(condition)
{
cin>> something;
node<T> *x;
x = new node<T> (something);
aStack.push(x);
}
i want to keep adding "something" to a stack, and top( ) and pop( ) it off,
but the problem is...... x is being overridden each time. how am i going to
manage the nodes in the stack ? thanks!