1 /* 2 * Initialization of unnamed structure members 3 */ 4 struct apoint { 5 int first; 6 struct { 7 double x; 8 }; 9 struct { 10 double y; 11 struct { 12 double z; 13 }; 14 char *s; 15 }; 16 int last; 17 } ap; 18 19 struct point { 20 union { 21 double x; 22 } u; 23 } p; 24 main()25int main() { 26 ap.x = 3; 27 (struct apoint) { .x = 42, .y = 12, 9, "hi" }; 28 (struct apoint) { .x = 42 }; 29 (struct apoint) { .y = 42 }; 30 (struct apoint) { .z = 42 }; 31 (struct apoint) { .y = 42, 12, "hi" }; 32 (struct apoint) { .z = 42, "hi" }; 33 34 p.u.x = 3; 35 (struct point) { { .x = 42 } }; 36 (struct point) { .u = { .x = 42 } }; 37 } 38