summaryrefslogtreecommitdiff
path: root/code
diff options
context:
space:
mode:
authorA404M <ahmadmahmoudiprogrammer@gmail.com>2025-04-07 10:31:58 +0330
committerA404M <ahmadmahmoudiprogrammer@gmail.com>2025-04-07 10:31:58 +0330
commit4ec0e96e32a271ff59099aa6bb4233b107195ccd (patch)
treee681c13aec21459040ac54444203e337c58e11fe /code
parentb5772e1c6961dd4b99b91b060b57584d4868aa2b (diff)
add struct + struct values + access by dot
Diffstat (limited to 'code')
-rw-r--r--code/main.felan21
1 files changed, 7 insertions, 14 deletions
diff --git a/code/main.felan b/code/main.felan
index f4b7608..27d664a 100644
--- a/code/main.felan
+++ b/code/main.felan
@@ -1,21 +1,14 @@
-char :: u8;
-short :: i16;
-int :: i32;
-long :: i64;
-float :: f32;
-double :: f64;
-
st :: struct {
- a : int;
- b : double;
+ a : u64;
+ b : f64;
};
main :: () -> void {
- b :u64= 2;
- c := &b;
- c.* = 4;
- print_u64 b;
a : st = undefined;
- a.a = 5;
+ a.a = 2;
+ print(a);
};
+print :: (value:st)->void{
+ print_u64 value.a;
+};