CPP : Linked List Deletion

In the code we use :
delete temp;
So , does it mean temp is a pointer also and also was dynamically allocated?

Hi @Riankk
Node *temp=head;
It means that temp is a pointer which points to the location of head.
And when we perform :

head=head->next;
delete temp;

In this we move head to one step forward and as temp points to the location of 1st node so when we use delete temp it just free the memory that was occupied by 1st node