source:
CIVL/examples/languageFeatures/structStruct.cvl@
d8bb437
| Last change on this file since d8bb437 was 4eccc907, checked in by , 13 years ago | |
|---|---|
|
|
| File size: 238 bytes | |
| Line | |
|---|---|
| 1 | #include <civlc.h> |
| 2 | |
| 3 | typedef struct foo { |
| 4 | struct { |
| 5 | int* a; |
| 6 | double b; |
| 7 | } bar; |
| 8 | } foo; |
| 9 | |
| 10 | void main() { |
| 11 | foo s; |
| 12 | int a[4]; |
| 13 | |
| 14 | a[2] = 3; |
| 15 | s.bar.b = 5.6; |
| 16 | s.bar.a = &a[1]; |
| 17 | $assert s.bar.b == 5.6; |
| 18 | $assert s.bar.a[1] == 3; |
| 19 | } |
Note:
See TracBrowser
for help on using the repository browser.
