source:
CIVL/examples/specialStatements/choose1.cvl
| Last change on this file was ea777aa, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 360 bytes | |
| Rev | Line | |
|---|---|---|
| [f654c25] | 1 | #include<civlc.cvh> |
| 2 | ||
| [d66b03b] | 3 | $scope root = $here; |
| [f654c25] | 4 | int main(){ |
| 5 | int *ptr, x=1, y=2; | |
| 6 | ||
| 7 | $choose{ | |
| 8 | if(x<=1){ | |
| 9 | int a1=0; | |
| 10 | y=a1; | |
| 11 | }else{ | |
| 12 | y=x+1; | |
| 13 | } | |
| 14 | $when(x<5){ | |
| 15 | $when(y>1){ | |
| 16 | y=10; | |
| 17 | int z=19; | |
| 18 | x=z; | |
| 19 | } | |
| 20 | } | |
| [d66b03b] | 21 | {ptr=(int*)$malloc(root, sizeof(int)); $free(ptr);} |
| [f654c25] | 22 | {int q=sizeof(int); ptr=(int*)$malloc($here, q); $free(ptr);} |
| 23 | } | |
| 24 | } |
Note:
See TracBrowser
for help on using the repository browser.
