source:
CIVL/examples/languageFeatures/malloc.cvl@
20a83c7
| Last change on this file since 20a83c7 was 0b9a80a, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 224 bytes | |
| Rev | Line | |
|---|---|---|
| [36b5ada] | 1 | /* Commandline execution: |
| 2 | * civl verify malloc.cvl | |
| 3 | * */ | |
| [6d158b4] | 4 | #include <civlc.h> |
| 5 | ||
| 6 | void main() { | |
| [78fdaf0] | 7 | $scope s = $here; |
| 8 | double *p = (double *) $malloc(s, 5*sizeof(double)); | |
| [6d158b4] | 9 | |
| [1dad7eb] | 10 | p[4]=3.14; |
| 11 | $assert(p[4]==3.14); | |
| [0b9a80a] | 12 | $free(p); |
| [6d158b4] | 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
