diff options
Diffstat (limited to 'struct.lang')
-rw-r--r-- | struct.lang | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/struct.lang b/struct.lang new file mode 100644 index 0000000..3297939 --- /dev/null +++ b/struct.lang @@ -0,0 +1,19 @@ +type S := struct { + int x; + char y; +}; + +func f(int iets1, S s, int iets2) { + putint(s.x); putc(s.y); putc('\n'); + putint(iets1); putc(' '); putint(iets2); putc('\n'); +} + +func int main() { + int a := getc(); + int b := getc(); + getc(); // newline + S ding := {x = 2*a, y = 'a'}; + // return ding.x; + f(123, ding, 456); + return int(ding.y) + a + b; +} |