source:
CIVL/mods/dev.civl.com/examples/library/pointer/incompatiblePointerTranslation_dir/incompatiblePointerTranslationUnion.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 211 bytes | |
| Line | |
|---|---|
| 1 | #include <pointer.cvh> |
| 2 | |
| 3 | int main() { |
| 4 | union _3int { |
| 5 | int x; |
| 6 | int y; |
| 7 | int z; |
| 8 | } a; |
| 9 | |
| 10 | union _2int { |
| 11 | int x; |
| 12 | int y; |
| 13 | } b; |
| 14 | |
| 15 | int * p = &a.z; |
| 16 | int * q = $translate_ptr(p, &b); |
| 17 | |
| 18 | return *q; |
| 19 | } |
Note:
See TracBrowser
for help on using the repository browser.
