source:
CIVL/examples/languageFeatures/union.cvl@
08299ed
| Last change on this file since 08299ed was 3ff27cf, checked in by , 11 years ago | |
|---|---|
|
|
| File size: 174 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 | ||
| [3ff27cf] | 11 | $assert((k.y == 8.4)); |
| [f972092] | 12 | k.x = 2; |
| [3ff27cf] | 13 | $assert((k.x == 2)); |
| [f972092] | 14 | } |
Note:
See TracBrowser
for help on using the repository browser.
