source:
CIVL/examples/experimental/unnamed_member_initialization.c@
afc300c
| Last change on this file since afc300c was 65582ca, checked in by , 8 years ago | |
|---|---|
|
|
| File size: 183 bytes | |
| Rev | Line | |
|---|---|---|
| [65582ca] | 1 | #include<assert.h> |
| 2 | ||
| 3 | struct T { | |
| 4 | struct { | |
| 5 | int x; | |
| 6 | int y; | |
| 7 | }; | |
| 8 | int z; | |
| 9 | }; | |
| 10 | ||
| 11 | int main() { | |
| 12 | struct T a = {.x = 1, .y = 2, .z = 3}; | |
| 13 | ||
| 14 | assert(a.x == 1 && a.y == 2 && a.z == 3); | |
| 15 | } |
Note:
See TracBrowser
for help on using the repository browser.
