阅读背景:

在struct中使用__attribute __((aligned())),为什么sizeof的结果是这样的?

来源:互联网 

This is my test code:

这是我的测试代码:

#include <cstdio>
struct A {
    int  a;
    int  b;
    int  c __attribute__((aligned(4096)));
    int  d;
}t;
int main()
{
    printf("%d\n",sizeof(t));

    return  0;
}
#include <



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: