source:
CIVL/mods/dev.civl.com/examples/sideEffects/postIncr.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 205 bytes | |
| Line | |
|---|---|
| 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.
