I have a doubt about linked lists..
Memory for structure variables are allocated only when they are declared.right....
Look at this
memory is allocated for s as it is declared.But again s contains another structure variable declaration (struct stud* next.This can hold a pointer to a variable of type struct stud..Code:struct stud { int a; struct stud* next; }s;
so its size is that much to hold that variable...Since it is a structure variable Its memory is allocated when it is declared using that statement.That pointer should point to another variable of struct stud.So Again that variable contains another declaration and this allocates memory again....This process continues..............
So then what is the size of the variable s.
Is the memory size of an address is specified by OS.Or is it item specific(ie. memory required to hold address of int variable and char variable are different.Or are they same.?
If same my doubt is cleared...