source:
CIVL/mods/dev.civl.com/examples/library/civlc/heap.cvl@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 336 bytes | |
| Line | |
|---|---|
| 1 | /** implementin $malloc using $havoc and $seq **/ |
| 2 | #include<civlc.cvh> |
| 3 | #include<seq.cvh> |
| 4 | #include<stdio.h> |
| 5 | |
| 6 | struct Heap{ |
| 7 | int h1[][]; |
| 8 | int h2[][]; |
| 9 | }; |
| 10 | |
| 11 | int main(){ |
| 12 | struct Heap h; |
| 13 | |
| 14 | //$seq_init(&h.h1, 0, NULL); |
| 15 | //$seq_init(&h.h2, 0, NULL); |
| 16 | |
| 17 | int tmp[5]; |
| 18 | $havoc(&tmp); |
| 19 | $seq_append(&h.h1, &tmp, 1); |
| 20 | printf("heap: %s\n", h); |
| 21 | } |
| 22 |
Note:
See TracBrowser
for help on using the repository browser.
