Suppose temp
is a pointer to structure node
. temp->next
is NULL
. So what will be the value of temp->next->next
?
In short what is the value of NULL->next
? Is it compiler dependent because I have seen different result in ubuntu and code blocks(windows)?
What will be the output of the program below?
struct node
{
int data;
struct node *next;
};
main()
{
struct node *temp,*p;
int c=0;
temp=(struct node *)malloc(sizeof(struct node));
temp->data=50;
temp->next=NULL;
p=temp;
if(p->next->next==NULL)//will it enter the if loop?
c++;
printf("%d",c);
}