Hello everyone,

I am making a program which acts like a library system. There are two classes: Book and List. The List class contains all the linked list information;

struct ListNode
  ListItemType item;
  ListNode *Next;

Now, my problem is in the Book class file (Book.cc). I have the List.h file included in Book.cc but i am unable to use any of the Linked List commands in Book.cc. Such as;

ListNode cur = new ListNode;
cur = head;
cur = cur->next;

I get the error;

Error 419: "Book.cc", line 40 # 'ListNode' is used as a type, but has not been defined as a type.

I've been beating my head against the wall trying to find a way to use the List class types in my Book class. I just cant think of anything.

8 Years
Discussion Span
Last Post by Narue

>The List class contains all the linked list information
This sounds like ListNode is a nested class. Most likely the problem is you're not properly qualifying the type:

List::ListNode cur = new List::ListNode;
cur = head;
cur = cur->next;
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.