as we allocate the space for node in linked list using malloc() so how many bytes malloc allocate for the 1 node i.e. actual value of malloc allocates in ram like i write this code.
so what is size of a node of linked list?
struct node *link;
struct node *temp;
temp = (struct node *)malloc(sizeof(struct node));
what the printf prints and why ?
Considering the size of pointer variable takes $8$ bytes and size of integer variable $4$ bytes.
Then the answer of $sizeof(struct node)$ would come $16$ .
This is because of padding added to satisfy alignment constraints. Alignment is very much important for performance and optimization of the program.
Here we try to make the structure size multiple of maximum size datatypes Here that is the pointer which is 8 byte.
So We pad 4 byte to int variable .
So now size of structure is $(8+8)=16$ byte
Watch this video :-https://www.youtube.com/watch?v=Kh_zZ85NQ8E&list=PLIPZ2_p3RNHgzQutUHGzqMjA1z7XJ_Uya&index=9