I think i have the push working .... at least no errors when I run it, but I am lost with the pop .... & in the program how do you 'push' & 'pop' the number to the stack????????
Code:
bool stacklist::push()
{
//ptrs = number(top), stacklist(head), push(nptr)
bool success;
number* nptr = new number;
nptr->remainder = rem;
if (head != NULL)
{
success = false;
}
else
{
if (head == NULL)
{
nptr->top = NULL;
head = nptr;
}
else
{
nptr->top = head;
head = nptr;
}
count++;
}
success = true;
}
bool stacklist::pop()
{
bool success;
number* dlptr = new number;
if (head != NULL)
{
success = false;
}
else
{
if (head == NULL)
{
cout << "Nothing to pop" << endl;
}
else
{
dlptr = top;
}
}
[MOD EDIT: Disabled Smilies]