source:
CIVL/examples/languageFeatures/union.cvl
| Last change on this file was ea777aa, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 170 bytes | |
| Rev | Line | |
|---|---|---|
| [e6b02c8] | 1 | #include <civlc.cvh> |
| [f972092] | 2 | |
| 3 | typedef union U{ | |
| 4 | int x; | |
| 5 | double y; | |
| 6 | } U1; | |
| 7 | ||
| 8 | void main() { | |
| 9 | U1 k = {.x = 1, .y = 8.4}; | |
| 10 | ||
| [d980649] | 11 | $assert(k.y == 8.4); |
| [f972092] | 12 | k.x = 2; |
| [d980649] | 13 | $assert(k.x == 2); |
| [f972092] | 14 | } |
Note:
See TracBrowser
for help on using the repository browser.
