source:
CIVL/examples/pointers.cvl@
8bd0ed8
| Last change on this file since 8bd0ed8 was b6565a0, checked in by , 13 years ago | |
|---|---|
|
|
| File size: 219 bytes | |
| Rev | Line | |
|---|---|---|
| [6543229] | 1 | #include<civlc.h> |
| 2 | ||
| 3 | void main() { | |
| 4 | int a; | |
| 5 | int* b; | |
| 6 | int c[2]; | |
| 7 | int* d; | |
| [b6565a0] | 8 | int** g; |
| 9 | ||
| [6543229] | 10 | a = 1; |
| 11 | b = &a; | |
| 12 | c[0] = 0; | |
| 13 | c[1] = 1; | |
| 14 | d = &c[1]; | |
| [b6565a0] | 15 | g = &d; |
| [6543229] | 16 | $assert *b == 1; |
| 17 | $assert *d == 1; | |
| [b6565a0] | 18 | $assert **g == 1; |
| 19 | ||
| [6543229] | 20 | } |
Note:
See TracBrowser
for help on using the repository browser.
