"Fossies" - the Fresh Open Source Software Archive

Member "ponyc-0.33.0/examples/ffi-struct/struct.c" (1 Nov 2019, 260 Bytes) of package /linux/misc/ponyc-0.33.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 typedef struct Inner
    2 {
    3   int x;
    4 } Inner;
    5 
    6 typedef struct Outer
    7 {
    8   struct Inner inner_embed;
    9   struct Inner* inner_var;
   10 } Outer;
   11 
   12 void modify_via_outer(Outer* s)
   13 {
   14   s->inner_embed.x = 10;
   15   s->inner_var->x = 15;
   16 }
   17 
   18 void modify_inner(Inner* s)
   19 {
   20   s->x = 5;
   21 }