source:
CIVL/mods/dev.civl.abc/examples/compound3.c
| Last change on this file was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 225 bytes | |
| Rev | Line | |
|---|---|---|
| [aad342c] | 1 | #include<assert.h> |
| 2 | ||
| 3 | struct T { | |
| 4 | int x; | |
| 5 | int y; | |
| 6 | struct T2 { | |
| 7 | int x; | |
| 8 | int y; | |
| 9 | } z; | |
| 10 | }; | |
| 11 | ||
| 12 | int main() { | |
| 13 | struct T t = {.y=2, {.x=3, 4, 5}}; | |
| 14 | ||
| 15 | assert(t.x == 0 && t.y == 2 && t.z.x == 3 && t.z.y == 5); | |
| 16 | return t.z.x; | |
| 17 | } |
Note:
See TracBrowser
for help on using the repository browser.
