source:
CIVL/mods/dev.civl.com/examples/experimental/unnamed_member_initialization.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 183 bytes | |
| Line | |
|---|---|
| 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.
