Homework/HW03/ListNode.cc
void ListNode::setNext(ListNode *link)
{
    if (this) // check if we even have a target object
        next = link;
    else        
    {
        cerr << "Accessing a NULL pointer. Terminating program now." << endl;
        exit(1);
    }
}
// Set the value of next.
Set the value of next.
Set the value of next .
void ListNode::setNext(ListNode *link)
{
    if (this) 
        next = link;
    else        
    {
        cerr << "Accessing a NULL pointer. Terminating program now." << endl;
        exit(1);
    }
}
void ListNode :: setNext ( ListNode * link ) { if ( this ) next = link ; else { cerr << " " << endl ; exit ( 1 ) ; } }
Set the value of next.
Set the value of next .
// check if we even have a target object