source: CIVL/examples/languageFeatures/pointerAddBad2.cvl

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 364 bytes
RevLine 
[e6b02c8]1#include <civlc.cvh>
[d010d61]2#include <stdio.h>
[e6b02c8]3
[d66b03b]4$scope root = $here;
5
[d010d61]6void main(){
7
8 int **p;
9 int ret;
10
[d66b03b]11 p = (int **)$malloc(root, sizeof(int *) * 10);
[d010d61]12 for(int i=0; i<10; i++){
[d66b03b]13 p[i] = (int *)$malloc(root, sizeof(int) * 10);
[d010d61]14 for(int j = 0; j<10; j++)
15 p[i][j] = i;
16 }
17
18 ret = *(&p[0][0] + 10);
[0c8fec8]19 for(int i=0; i<10; i++)
20 $free(p[i]);
[d010d61]21 $free(p);
22}
Note: See TracBrowser for help on using the repository browser.