1.8. cstruct declaration

The cstruct keyword can be used like struct, and has the same effect, except that no struct is actually generated by Felix, instead, the nominated struct is assumed to be defined in embedded C/C++ header code somewhere.
Start C++ section to tut/examples/tut_bind150.flx[1 /1 ]
     1: include "std";
     2: 
     3: header """
     4: struct X { int a; int b; };
     5: """;
     6: body """
     7: X rev(X x) { X y; y.a=x.b; y.b=x.a; return y; }
     8: """;
     9: 
    10: cstruct X { a: int; b: int; };
    11: fun rev: X -> X = "rev($a)";
    12: val x:X = X(1,2);
    13: print x.a; print " "; print x.b; endl;
    14: val y:X = rev x;
    15: print y.a; print " "; print y.b; endl;
    16: 
End C++ section to tut/examples/tut_bind150.flx[1]