aboutsummaryrefslogtreecommitdiff
path: root/struct.lang
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-09-01 23:09:41 +0200
committertomsmeding <tom.smeding@gmail.com>2017-09-01 23:09:41 +0200
commit2a54765a590e1d393442262002885adcbfe156cd (patch)
tree67ebe55705c11657551b04d63e5b496d1abbb721 /struct.lang
parent19c70b8eaa1126f1648b009d99092432a5c88059 (diff)
Global structs, better imul/idiv
Diffstat (limited to 'struct.lang')
-rw-r--r--struct.lang4
1 files changed, 4 insertions, 0 deletions
diff --git a/struct.lang b/struct.lang
index 3297939..5bd38c4 100644
--- a/struct.lang
+++ b/struct.lang
@@ -3,12 +3,16 @@ type S := struct {
char y;
};
+S global := {x = 1, 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() {
+ // global.x = 3 * global.x + int(global.y);
+ putint(global.x + 1); putc(global.y); putc('\n');
int a := getc();
int b := getc();
getc(); // newline