Mercurial > hg > CbC > old > device
view test/tmp11.c @ 927:b491db049d74
Added tag current-release for changeset 4e73a22327a8
author | kono |
---|---|
date | Sun, 13 Apr 2014 10:20:02 +0900 |
parents | d712ee10feb7 |
children |
line wrap: on
line source
int printf(const char *format, ...); typedef struct nametable { char *nm; int sc,ty,dsp; } NMTBL; NMTBL *a; NMTBL f; NMTBL * test2(char *n) { printf("#0010:s %s\n",n); return a; } int test0(int a,int b,int c) { printf("#0016:a %d b %d c %d\n",a,b,c); return 0; } int test1(a,b,c) int a,b;int c; { 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("#0040:return %d\n",d); NMTBL **p = (NMTBL**)&heap[2]; *p = &f; b = &f; int e = 0; printf("#0046:f.nm %s\n",f.nm); printf("#0047:b->nm %s\n",b->nm); printf("#0048:(*p)->nm %s\n",(*p)->nm); printf("#0049:ncaddr(e)->nm %s\n",ncaddr(e)->nm); return d; } /* end */