程序在 32 位机器(使用 GCC)上的输出是什么?解释。
#include<stdio.h>
int main() {
struct node {
int data;
struct node *link;
};
struct node *p, *q;
p = (struct node *) malloc(sizeof(struct node));
q = (struct node *) malloc(sizeof(struct node));
printf("%d, %d\n", sizeof(p), sizeof(q));
return 0;
}
输出显示
4、4。
上述程序是否与结构成员对齐填充和数据打包有关?