1. numberlist.h file
  2.  
  3.  
  4. // Specification file for the NumberList class
  5. #ifndef NUMBERLIST_H
  6. #define NUMBERLIST_H
  7.  
  8. class NumberList
  9. {
  10. private:
  11. // Declare a structure for the list
  12. struct ListNode
  13. {
  14. int value; // The value in this node
  15. struct ListNode *next; // To point to the next node
  16. };
  17.  
  18. ListNode *head; // List head pointer
  19.  
  20. public:
  21. // Constructor
  22. NumberList()
  23. { head = NULL; }
  24.  
  25. // Destructor
  26. ~NumberList();
  27.  
  28. // Linked list operations
  29. void appendNode(int);
  30. void insertNode(int);
  31. void deleteNode(int);
  32. void displayList() const;
  33. };
  34. #endif