diff test/tmp11.c @ 832:bc919d849346

arrow in parse mode
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 03 Dec 2010 13:29:19 +0900
parents a379da780856
children d712ee10feb7
line wrap: on
line diff
--- a/test/tmp11.c	Fri Dec 03 11:32:50 2010 +0900
+++ b/test/tmp11.c	Fri Dec 03 13:29:19 2010 +0900
@@ -4,6 +4,7 @@
         char *nm;
         int sc,ty,dsp; } NMTBL;
 NMTBL *a;
+NMTBL f;
 
 NMTBL *
 test2(char *n) {
@@ -24,13 +25,31 @@
     return test0(a,b,c);
 }
 
+int heap[10];
+
+#define ncaddr(e)   (*(NMTBL**)&heap[e+2])
+
 int
 main()
 {
     int d;
     NMTBL *b;
+    f.nm = "_name";
+    a = &f;
     b = test2("test");
     d = test1(1,2,3);
     printf("#0033:return %d\n",d);
+
+    NMTBL **p = (NMTBL**)&heap[2];
+    *p = &f;
+    b = &f;
+    int e = 0;
+    printf("f.nm          %s\n",f.nm);
+    printf("b->nm         %s\n",b->nm);
+    printf("(*p)->nm      %s\n",(*p)->nm);
+    printf("ncaddr(e)->nm %s\n",ncaddr(e)->nm);
+
     return d;
 }
+
+/* end */