summaryrefslogtreecommitdiff
path: root/05/main.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-02-12 14:12:01 -0500
committerpommicket <pommicket@gmail.com>2022-02-12 14:12:01 -0500
commit864b23702a8e867d6361acd3cef7b505cfedf552 (patch)
tree97567ee4328a67e0fac13e54db304478c3ee9298 /05/main.c
parent0ee06ac2c466149097ed411cb648dfbe17ff4098 (diff)
codegen for address of
Diffstat (limited to '05/main.c')
-rw-r--r--05/main.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/05/main.c b/05/main.c
index bf93d6f..3e43bf8 100644
--- a/05/main.c
+++ b/05/main.c
@@ -1,6 +1,15 @@
static char x = -2;
+
+typedef struct {
+ int x;
+ char y;
+ int z;
+} Structure;
+
+
long main(int argc, char **argv) {
- int y[] = {38, 55, -22};
- int *z = (y+2)[-1];
- return *z;
+Structure s[] = {3, 5, -88,6,9,12};
+ Structure *ps = s;
+ int *p = &ps->z;
+ return *p;
}