source: CIVL/examples/languageFeatures/malloc.cvl@ 38b7d06

1.23 2.0 main test-branch
Last change on this file since 38b7d06 was 1dad7eb, checked in by Stephen Siegel <siegel@…>, 13 years ago

Implemented free, fixed malloc. Malloc test now passing.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@172 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 161 bytes
Line 
1#include <civlc.h>
2
3void main() {
4 $heap h;
5 double *p = (double *) $malloc(&h, 5*sizeof(double));
6
7 p[4]=3.14;
8 $assert(p[4]==3.14);
9 $free(&h, p);
10}
Note: See TracBrowser for help on using the repository browser.