head =(struct node *)malloc(sizeof(struct node));/*allocated first node*/
printf("Before if comparison address of head %x\n",head);
//terminate if memory not allocated
if (head=NULL)
{
printf("unable to allocate memory");
exit(1);
}
printf("After if comparison address of head %x\n",head);
// take input from user
What do you think does the red highlighted code do ??
Try to print the address of head before the If statement & after checking it.
Hint : Please check syntax to how to compare & the syntax to assign variables.
:)