EmbLogic's Blog

SizeofStruct

struct Node
{
int data;
struct Node *next;
}var;
int main()
{
printf(“SIze of struct = %d\n”, sizeof(struct Node));
return 0;
}
Here it is printing 16.
Can someone explain how it is printing 16?

2 Responses to SizeofStruct

  1. gaurav sharma says:

    in my case it is printing 8 only….it depends on the computer architecture…nothing much to worry

Leave a Reply to gaurav sharma Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>