以下の内容はhttps://iww.hateblo.jp/entry/20160905/structより取得しました。


構造体の大きさ

#include <stdio.h>

typedef struct {
    char a;
    int b;
    char c;
} hoge_t;

int main(void) {
    printf("sizeof(hoge_t)=%d\n", sizeof(hoge_t));
    return 0;
}

gcc version 4.9.2
32bit環境の場合

sizeof(hoge_t)=12

64bit環境の場合

sizeof(hoge_t)=12

てっきり64bit環境では24バイトになると思ってたけど、アライメントは4の倍数のままなんだ。




以上の内容はhttps://iww.hateblo.jp/entry/20160905/structより取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14