source:
CIVL/examples/sideEffects/postIncr.cvl@
ecfe5bf
| Last change on this file since ecfe5bf was cabe6b08, checked in by , 11 years ago | |
|---|---|
|
|
| File size: 203 bytes | |
| Rev | Line | |
|---|---|---|
| [cabe6b08] | 1 | #include <civlc.cvh> |
| 2 | ||
| 3 | $input int N=5; | |
| 4 | int counter = 0; | |
| 5 | ||
| 6 | int incrCounter(){ | |
| 7 | return counter++; | |
| 8 | } | |
| 9 | ||
| 10 | int main(){ | |
| 11 | for(int i = 0; i < N; i++){ | |
| 12 | int count = incrCounter(); | |
| 13 | ||
| 14 | $assert(i == count); | |
| 15 | } | |
| 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
