#include #include "listNode.h" using namespace std; // Constructor for Class ListNode ListNode::ListNode(int element = 0) // 0 is the default argument { data = element; link = NULL; // null pointer constant cout << "allocated ListNode " << this << " with initial value " << data << endl; } ListNode::~ListNode() { std::cout << "deallocated ListNode " << this << std::endl;} void ListNode::SetNext(ListNode * ptr) {link = ptr; return;} ListNode* ListNode::GetNext() {return link;} void ListNode::SetData(int x) {data = x; return;} int ListNode::GetData() {return data;}