Ejemplo n.º 1
0
void theStack::clear()
{
    if (anchor->next)
        nukem(anchor->next);// anchor holds no key, so start from its next
    tos = -1;
    anchor = new node();
    anchor->next = NULL;
}
Ejemplo n.º 2
0
theStack::~theStack()
{
    if (anchor->next)
        nukem(anchor->next);// anchor holds no key, so start from its next
    anchor = new node();
    anchor->next = NULL;
    tos = -1;
}
Ejemplo n.º 3
0
MixedNum& MixedNum::operator=(const MixedNum &other)
{
    if (this != &other)
    {
        nukem();
        copy(other);
    }
    return *this;
}
Ejemplo n.º 4
0
void theStack::resize(int s)
{
    cap = s;
    if(s < 1)
        throw sINVALID_SIZE;
    if (anchor->next)
        nukem(anchor->next);// anchor holds no key, so start from its next
    tos = -1;
}
Ejemplo n.º 5
0
theStack& theStack::operator=(const theStack &other)
{
    if(this != &other)
    {
        if (anchor->next)
            nukem(anchor->next);// anchor holds no key, so start from its next
        anchor = new node();
        anchor->next = NULL;
        copy(other);
    }
    return *this;
}
Ejemplo n.º 6
0
MixedNum::~MixedNum()
{
    nukem();
}
Ejemplo n.º 7
0
parser::~parser()
{
    nukem();
}
Ejemplo n.º 8
0
void theStack::nukem(node* top)
{
    if (top->next)
        nukem(top->next);
    bye(top); // changed from !top->next
}