#include <stdio.h>
struct SIMPLE
{
int a;
char b;
double c;
} simple;
//此结构体的声明包含了其他的结构体
struct COMPLEX
{
char string[100];
struct SIMPLE a;
} complex;
/此结构体的声明包含了指向自己类型的指针
struct NODE
{
char string[100];
struct NODE *next_node;
}node;
int main()
{
printf( "Memory size occupied by a: %d\n", sizeof(a));
printf( "Memory size occupied by complex: %d\n", sizeof(a));
printf( "Memory size occupied by node: %d\n", sizeof(node));
}
为什么结果显示a是16,complex是120,node是112?