#include <stdio.h>
#include <stdlib.h>
struct s_static
{
int ns[5];
};
struct s_dynamic
{
int *ns;
};
int main(void)
{
struct s_static a;
struct s_dynamic b;
b.
ns = (int *) malloc(5 * sizeof(int));
printf("Size of static = %d and size of the dynamic = %d", sizeof(a
), sizeof(b
)); return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KCnN0cnVjdCBzX3N0YXRpYyAKewoJaW50IG5zWzVdOwp9OwoKc3RydWN0IHNfZHluYW1pYwp7CglpbnQgKm5zOwp9OwoKaW50IG1haW4odm9pZCkgCnsKCXN0cnVjdCBzX3N0YXRpYyBhOwoJc3RydWN0IHNfZHluYW1pYyBiOwoJYi5ucyA9IChpbnQgKikgbWFsbG9jKDUgKiBzaXplb2YoaW50KSk7CgoJcHJpbnRmKCJTaXplIG9mIHN0YXRpYyA9ICVkIGFuZCBzaXplIG9mIHRoZSBkeW5hbWljID0gJWQiLCBzaXplb2YoYSksIHNpemVvZihiKSk7CglyZXR1cm4gMDsKfQ==