Let’s see the code below.

/* List class */

#include <stdlib.h>

#include "Node.cpp"

class List

{

public:

// Constructor

List()

{

headNode = new Node();

headNode->setNext(NULL);

currentNode = NULL;

size = 0;

};

We are creating a list factory here employed to create list objects. Remember the list operations; add, remove, next, back and start etc. Let’s see the above class declaration code in detail.

 

BACK

HOME

NEXT