// Program to insert node at front in linked list. //This is a simple program in linked list but I do not understand the difference between // values of &newNode,newNode and newNode->next
void PushAtFrontLinkList(int value) { if(head==NULL) { head=tail; } node* newNode=new node(); newNode->data=value; newNode->next=head; head=newNode; // Trying to differentiate between data contained in newNode and &newNode and newNode->next cout<<"just new node"<<newNode<<endl; // what will be contained in newNode? cout<<"address of node"<<&newNode<<endl; // what will be contained in &newNode? cout<<"new node next"<<newNode->next<<endl; // It will be the address of the next node? }
node *, pointer tonodeand pointer tonoderespectively.