view CbC-examples/rectypeTest/typedef.cbc @ 107:a3a2f64cf8f4

modify implementation of rectype
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Thu, 14 Jun 2012 19:44:54 +0900
parents 85047c4f1ca4
children
line wrap: on
line source

typedef __code (CS)(__rectype*); // CS *p

//typedef __code (*CS)(__code(*p)());
//typedef __code (CS)(__code(*p)()); // CS *p

#include <stdio.h>
__code cs_end(CS *p)
{
  printf("end\n");
}

__code cs(CS *p)
{
  CS *b; 
  goto p(b);
//  goto p("aaa"); //note: expected ‘void (*)’ but argument is of type ‘char
}

int main() {
  CS *p;
  p = cs_end;
  goto cs(p);
  return 0;
}