4 struct gstudent char name20 int height float

  • Slides: 11
Download presentation

構造体 4 定義 struct gstudent { char name[20]; int height; float weight; }; struct

構造体 4 定義 struct gstudent { char name[20]; int height; float weight; }; struct xyz a, b; 枠組みの宣言 struct gstudent { char name[20]; int height; float weight; } a, b; オブジェクトの定義 http: //www. center. nitech. ac. jp/~sfukui/ouyou/list 13 -1. c

構造体 4 構造体とポインタで構造体を指すこともできる。 struct xyz { int x; long y; double z; } a;

構造体 4 構造体とポインタで構造体を指すこともできる。 struct xyz { int x; long y; double z; } a; struct xyz *p; p = &a; (*p). x = 20; (*p). y = 100; (*p). z = 3. 14; or p = &a; p->x = 20; p->y = 100; p->z = 3. 14; http: //www. center. nitech. ac. jp/~sfukui/ouyou/list 13 -4. c