source: CIVL/examples/languageFeatures/pointerAddBad2.cvl@ dfb0fef

1.23 2.0 main test-branch
Last change on this file since dfb0fef was e6b02c8, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

updates CIVL to use the new ABC FrontEnd. tests updated accordingly when necessary.

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

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