view 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
line wrap: on
line source


struct interface {
  __code (*next)();
 __rectype child;
  // __rectype *child;
  //  struct interface *child;
};

#include <stdio.h>
__code csA()
{
  printf("csA\n");
}

__code csB()
{
  printf("csB\n");
}

int main()
{
  struct interface p;
  p.next = csA;

  struct interface pp;
  pp.next = csB;
  p.child = &pp;

  //  goto p.child->next();
  goto p.child->next();
  
  return 0;
}