1.23
2.0
acw/focus-triggers
main
sendrecv_bug
test-branch
| 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.