source:
CIVL/examples/sideEffects/postIncr.cvl@
beab7f2
| Last change on this file since beab7f2 was ea777aa, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 205 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 | ||
| [3ff27cf] | 14 | $assert((i == count)); |
| [cabe6b08] | 15 | } |
| 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
