source:
CIVL/examples/languageFeatures/malloc.cvl@
e5c6156
| Last change on this file since e5c6156 was 1de5580, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 223 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); | |
| [1de5580] | 12 | free(p); |
| [6d158b4] | 13 | } |
Note:
See TracBrowser
for help on using the repository browser.
