aboutsummaryrefslogtreecommitdiff
path: root/examples/hello-world.cff
diff options
context:
space:
mode:
Diffstat (limited to 'examples/hello-world.cff')
-rw-r--r--examples/hello-world.cff12
1 files changed, 10 insertions, 2 deletions
diff --git a/examples/hello-world.cff b/examples/hello-world.cff
index c4a99ea..0ffca9f 100644
--- a/examples/hello-world.cff
+++ b/examples/hello-world.cff
@@ -1,6 +1,14 @@
import "libc.hff";
-extern fn main(argc int, argv *const *const u8) int {
- printf("hello %d", argc + 42);
+extern fn main(argc int, argv **u8) int {
+ *argv = "hi";
+ while argc > 0 {
+ argc = argc - 1;
+ }
+
+ printf("hello %d", argc + 42,
+ argc < 1 ? argv : #null,
+ *argv
+ );
}