Why isn't this program working?

I am trying to allocate a node variable on the heap using "new". Im trying to do this in the function enqueue. The error highlights "node* node=new node;" and says that it is the following:"forward declaration of node","must use class tag to refer to type node in this scope","class node is hidden by a non-type declaration of type node here", and "allocation of incomplete type 'class node'. Can you guys tell me what these mean and whats wrong with the statement?

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

class node
{
public:

	int number;
	node* nextPtr=NULL;
};

class queue
{
	node* front;
	node* end;
	int count=0;

public:

	void enqueue(int Number)
	{
		
		node* node=new node;

		node->number=Number;

		front=&node;
		end=&node;
		count++;
	}
Naming a variable the same as a class is usually not a good idea, why are you naming that pointer variable node when you have a class with that name in the same scope?
@Jib, thank you it worked.
Topic archived. No new replies allowed.