source:
CIVL/examples/languageFeatures/calloc.cvl@
04c71e3
| Last change on this file since 04c71e3 was 33ccc0c, checked in by , 9 years ago | |
|---|---|
|
|
| File size: 306 bytes | |
| Line | |
|---|---|
| 1 | /* Commandline execution: |
| 2 | * civl verify malloc.cvl |
| 3 | * */ |
| 4 | #include <civlc.cvh> |
| 5 | #include <string.h> |
| 6 | #include <stdlib.h> |
| 7 | |
| 8 | void main() { |
| 9 | double *p = calloc(5, sizeof(double)); |
| 10 | |
| 11 | $assert(p[0]==0.0); |
| 12 | $assert(p[1]==0.0); |
| 13 | $assert(p[2]==0.0); |
| 14 | $assert(p[3]==0.0); |
| 15 | $assert(p[4]==0.0); |
| 16 | $free(p); |
| 17 | } |
Note:
See TracBrowser
for help on using the repository browser.
