comparison CbC-examples/rectypeTest/typedef2.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 typedef __code (*csPtr)(__rectype);
2
3 //typedef __code (*csPtr)(__code(*p)());
4 //typedef __code (csPtr)(__code(*p)()); // csPtr *p
5
6 #include <stdio.h>
7 __code cs_end(csPtr p)
8 {
9 printf("end\n");
10 }
11
12 __code cs(csPtr p)
13 {
14 csPtr b;
15 goto p(b);
16 // goto p(3); // note: expected ‘void (*)()’ but argument is of type ‘int’
17 }
18
19 int main() {
20 csPtr p;
21 p = cs_end;
22 goto cs(p);
23 return 0;
24 }