Set Class - Copy Constructor error

Hey,
This is my first post on any forum so please try to bear with me. I've run into an error with my copy constructor. Actually I think the problem is somewhere else.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Set::Set()
{
	Count = 0;
	Head = new (nothrow) Node;
	Head->Next = NULL;
}

// De-initialize the set
//
Set::~Set()
{
	Node * Temp1 = Head->Next;
	Node * Temp2;
	while (Temp1 != NULL)
	{
		Temp2 = Temp1;
		Temp1 = Temp1 -> Next;
		delete Temp2;
	}
	Head -> Next = NULL;
	Count = 0;
	delete Head;
	Head = NULL;
}

// Initialize the set using an existing set
//
Set::Set( const Set& A)
{

	Head = new (nothrow) Node;
	Head -> Next = NULL;
	Node * Temp1 = A.Head->A.Next;
	
	while(Temp1 != NULL)
	{
		Temp1 = Temp1 -> A.Next;
		insert(Temp1->Item);
	}

}

Here is part of my interface file where the Node is constructed.
1
2
3
4
5
6
7
8
9
10
11
 private:

    struct Node
    {
      int Element;   // User data item
      Node * Next;   // Link to the node's successor
    };

    unsigned Count;  // Number of user data items in the set
    Node * Head;     // Link to the head of the chain


And here is the error that I get
1
2
3
4
proj08.set.cpp: In copy constructor 'Set::Set(const Set&)':
proj08.set.cpp:46: error: 'struct Set::Node' has no member named 'A'
proj08.set.cpp:50: error: 'struct Set::Node' has no member named 'A'
proj08.set.cpp:51: error: 'struct Set::Node' has no member named 'Item'


Any help or suggestions are greatly appreciated.
Shouldn't A.Head->A.Next be A.Head->Next?

The Item error makes sense as it doesn't exist. Did you mean Element?
Wow. That cleared of both of those errors. Thank you for the help. I find all of this chaining stuff so confusing.
Cool. Good stuff. :-)
Topic archived. No new replies allowed.