source: CIVL/examples/languageFeatures/pointerSubtractionBad2.cvl@ a389857

main test-branch
Last change on this file since a389857 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: 360 bytes
Line 
1#include <stdlib.h>
2#include <stddef.h>
3#include <civlc.cvh>
4
5$scope root = $here;
6
7int main(){
8 ptrdiff_t diff;
9 double ** x;
10
11 x = (double **)$malloc(root, sizeof(double *) * 3);
12 for(int i=0; i<3; i++)
13 x[i] = (double *)$malloc(root, sizeof(double) * 2);
14
15 diff = x[1] - x[0];
16
17 for(int i=0; i<3; i++)
18 $free(x[i]);
19 $free(x);
20
21 return 0;
22}
23
24
Note: See TracBrowser for help on using the repository browser.