comparison CbC-examples/rectypeTest/struct2.cbc @ 108:7ad14f446135

add CbC-example/rectypeTest/
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Thu, 14 Jun 2012 20:30:24 +0900
parents
children
comparison
equal deleted inserted replaced
107:a3a2f64cf8f4 108:7ad14f446135
1
2 struct interface {
3 __code (*next)();
4 __rectype child;
5 // __rectype *child;
6 // struct interface *child;
7 };
8
9 #include <stdio.h>
10 __code csA()
11 {
12 printf("csA\n");
13 }
14
15 __code csB()
16 {
17 printf("csB\n");
18 }
19
20 int main()
21 {
22 struct interface p;
23 p.next = csA;
24
25 struct interface pp;
26 pp.next = csB;
27 p.child = &pp;
28
29 // goto p.child->next();
30 goto p.child->next();
31
32 return 0;
33 }