source:
CIVL/examples/languageFeatures/pointerAddBad2.cvl@
85120bb
| Last change on this file since 85120bb was d010d61, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 299 bytes | |
| Rev | Line | |
|---|---|---|
| [d010d61] | 1 | #include <civlc.h> |
| 2 | #include <stdio.h> | |
| 3 | void main(){ | |
| 4 | ||
| 5 | int **p; | |
| 6 | int ret; | |
| 7 | ||
| 8 | p = (int **)$malloc($root, sizeof(int *) * 10); | |
| 9 | for(int i=0; i<10; i++){ | |
| 10 | p[i] = (int *)$malloc($root, sizeof(int) * 10); | |
| 11 | for(int j = 0; j<10; j++) | |
| 12 | p[i][j] = i; | |
| 13 | } | |
| 14 | ||
| 15 | ret = *(&p[0][0] + 10); | |
| 16 | $free(p); | |
| 17 | } |
Note:
See TracBrowser
for help on using the repository browser.
