source:
CIVL/mods/dev.civl.com/examples/languageFeatures/initialValues.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 319 bytes | |
| Line | |
|---|---|
| 1 | #include<stdio.h> |
| 2 | #include<civlc.cvh> |
| 3 | #include<bundle.cvh> |
| 4 | |
| 5 | typedef enum INIT {zero, one} Init; |
| 6 | typedef union{ |
| 7 | int a; |
| 8 | float b; |
| 9 | } MyUnion; |
| 10 | |
| 11 | $bundle bun; |
| 12 | Init enumVar; |
| 13 | int * ptr; |
| 14 | MyUnion myunion; |
| 15 | int main() { |
| 16 | int a; |
| 17 | |
| 18 | a = enumVar; |
| 19 | a = myunion.a; |
| 20 | ptr = &a; |
| 21 | $bundle_unpack(bun, &a); |
| 22 | return 0; |
| 23 | } |
Note:
See TracBrowser
for help on using the repository browser.
