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
|
| Line | |
|---|
| 1 | #include <civlc.cvh>
|
|---|
| 2 | #include <stdio.h>
|
|---|
| 3 |
|
|---|
| 4 | $scope root = $here;
|
|---|
| 5 |
|
|---|
| 6 | void main(){
|
|---|
| 7 |
|
|---|
| 8 | int **p;
|
|---|
| 9 | int ret;
|
|---|
| 10 |
|
|---|
| 11 | p = (int **)$malloc(root, sizeof(int *) * 10);
|
|---|
| 12 | for(int i=0; i<10; i++){
|
|---|
| 13 | p[i] = (int *)$malloc(root, sizeof(int) * 10);
|
|---|
| 14 | for(int j = 0; j<10; j++)
|
|---|
| 15 | p[i][j] = i;
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | ret = *(&p[0][0] + 10);
|
|---|
| 19 | for(int i=0; i<10; i++)
|
|---|
| 20 | $free(p[i]);
|
|---|
| 21 | $free(p);
|
|---|
| 22 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.