class node{
public:
int data;
node* next;
node(int val){
data=val;
next=NULL;
}
};
For this class, the object creation statement is node* n=new node(5);
Why do we need to add the *
after node
? What will happen if I write node n=new node(5)
?
Are they both the same?