source:
CIVL/examples/languageFeatures/scoping.cvl@
21cfdbe
| Last change on this file since 21cfdbe was 36b5ada, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 218 bytes | |
| Rev | Line | |
|---|---|---|
| [36b5ada] | 1 | /* Commandline execution: |
| 2 | * civl verify scoping.cvl | |
| 3 | * */ | |
| [793cfc2] | 4 | #include <civlc.h> |
| 5 | ||
| 6 | void main() { | |
| 7 | int x = 0; | |
| 8 | ||
| 9 | for (int i = 0; i < 5; i++) { | |
| 10 | int x = i + 1; | |
| 11 | x++; | |
| 12 | $assert x == i + 2; | |
| 13 | } | |
| 14 | $assert x == 0; | |
| 15 | } |
Note:
See TracBrowser
for help on using the repository browser.
