source:
CIVL/mods/dev.civl.com/examples/languageFeatures/pointerAddBad4.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 192 bytes | |
| Line | |
|---|---|
| 1 | #include <assert.h> |
| 2 | |
| 3 | int main(int argc, char * argv[]) { |
| 4 | int a[2][2][2] = {{{0,1}, {2,3}}, {{4,5}, {6,7}}}; |
| 5 | void *p = (&a + 1); |
| 6 | int t; |
| 7 | |
| 8 | t = *((int*)p); |
| 9 | assert(t == 1); |
| 10 | return 0; |
| 11 | } |
Note:
See TracBrowser
for help on using the repository browser.
