のサイズを調査するコードを記載しました。 #include<stdio.h> // 構造体(char型のみ) typedef struct struct_c1 { char char1; }struct_c1; typedef struct struct_c2 { char char1; char char2; }struct_c2; typedef struct struct1_c3 { ...
異なる型の変数をひとまとめにして扱うための型である。 関連するデータを1つのまとまりとして表現できる。 なぜ必要か 基本型だけで人物情報を表すと、次のようになる。 . は構造体のメンバにアクセスする演算子である。 順番は定義順に従う。 指定 ...