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