Mercurial > hg > CbC > old > examples
annotate struct-ptr-arg.c @ 5:709cdf828033
update tags
author | convert-repo |
---|---|
date | Mon, 08 Dec 2008 19:26:11 +0000 |
parents | e59ebf6fe2b0 |
children |
rev | line source |
---|---|
0 | 1 extern int printf(char*,...); |
2 struct interface { | |
3 int i; | |
4 int num; | |
5 char **arg; | |
6 code (*ret)(); | |
7 void *env; | |
8 }; | |
9 void | |
10 huga(struct interface *intf) | |
11 { | |
12 printf("%x\n", (unsigned long)intf); | |
13 } | |
14 int | |
15 main() | |
16 { | |
17 struct interface a; | |
18 struct interface *b=&a; | |
19 printf("%x\n", (unsigned long)b); | |
20 b->i=1; | |
21 b->num=2; | |
22 b->arg=(void*)3; | |
23 b->ret=return; | |
24 b->env=environment; | |
25 huga(b); | |
26 return(0); | |
27 } |