I have the following Structs
struct node{
int value;
struct node *next;
struct node *prev;
};
And I think that the size must be greater than sizeof(integer).
But it’s confusing how to calculate the whole size of this struct.
So how to caculate the size?
I mean I want to calculate it manually by hand, not by computer…
Generally, size of structure is addition of size of each member field. But compiler may add some extra bytes for padding/align members appropriately.
So in your case,
This is general guideline may differ depending upon compiler/platform you choose.