#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
struct node
{
int id;
struct node *next;
};
typedef struct node NODE;
int main()
{
NODE *hello;
hello=(NODE *) malloc(sizeof(NODE));
hello->id=5;
printf("\nAfter malloc\n");
printf("address of hello: %d ",hello);
printf("\n");
printf("Value of Id is: %d , Value of next is: %u\n",hello->id,hello->next);
return 0;
}
I tried to execute the above code, I got the following output.
Output:
After Malloc
address of hello: 16949264
Value of Id is:5, value of next is: 0
My question is, why the value of hello is not assigned to next?