source:
CIVL/examples/cast/structDown1.cvl
| Last change on this file was 021e161, checked in by , 18 months ago | |
|---|---|
|
|
| File size: 142 bytes | |
| Rev | Line | |
|---|---|---|
| [021e161] | 1 | typedef int A; |
| 2 | ||
| 3 | struct B { | |
| 4 | A a; | |
| 5 | double d; | |
| 6 | } b; | |
| 7 | ||
| 8 | int main(void) { | |
| 9 | struct B * p = &b; | |
| 10 | A * q = (A*)p; | |
| 11 | *q = 10; | |
| 12 | $assert(b.a == 10); | |
| 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
