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?
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?
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
in my case it is printing 8 only….it depends on the computer architecture…nothing much to worry
http://www.geeksforgeeks.org/archives/9705 very good article on structure memory alignment,padding and data packing…give it a quick read