I am writing a program that reads customer info from a file, then reads transactions from another. I am building my ADTs for this as I cannot use templates for this class yet and have a cpl of issues. The linked list contains the clientID as an int and a Queue with max of 4 entries that has nodes. The nodes contain an int and a double. I am attaching files for convienence
I think I am not creating an instance in my constructor or something similar. The errors from compiling the ADTs only are as follows.

g++ green.h Green.cc Queue.h Queue.cc -c
Green.cc: In constructor `ClientList::ClientList()':
Green.cc:20: error: `data' was not declared in this scope
green.h: In constructor `Customer::Customer()':
green.h:21: error: no matching function for call to `Queue::Queue()'
Queue.h:34: note: candidates are: Queue::Queue(const Queue&)
Queue.h:33: note: Queue::Queue(QueueNode)
Green.cc: In constructor `ClientList::ClientList()':
Green.cc:20: note: synthesized method `Customer::Customer()' first required here

Member Avatar

reen.cc:20: error: `data' was not declared in this scope

To help you start, the line

data = new Customer;


ClientList::ClientList()						// constructor
	data = new Customer;
	head = NULL;

is actually a member of the structure ListNode

struct ListNode
				Customer data;
				struct ListNode *next;

With that in mind, you will need to figure out how to access data with this information.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.