From 46e9f54322682d958879edfc59f8943d195ad5a5 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Tue, 30 Jan 2024 19:55:51 +0100 Subject: [PATCH] Updated hello world. --- src/components/sample.astro | 2 +- .../docs/guide/my-first-hello-world.md | 80 +++++++++++++++++-- 2 files changed, 74 insertions(+), 8 deletions(-) diff --git a/src/components/sample.astro b/src/components/sample.astro index f3c51de..fc30dce 100644 --- a/src/components/sample.astro +++ b/src/components/sample.astro @@ -57,7 +57,7 @@ class="flex items-center gap-x-3.5 py-2 px-3 rounded-md text-sm text-gray-800 hover:bg-gray-100 focus:ring-2 focus:ring-blue-500 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-gray-300" href="https://github.com/c3lang/c3c/releases/download/latest/c3-macos.zip" > - Macos + macOS c3c compile hello_world.c3 +``` + +And run it: + +``` +> ./hello_world +``` + +It should print `Hello, World!` and return back to the command line prompt. +If you are on Windows, you will have `hello_world.exe` instead. Call it in the same way. + +### Compiling and running + +When we start out it can be useful to compile and then have the compiler start the +program immediately. We can do that with `compiler-run`: + +``` +> c3c compile-run hello_world.c3 +Program linked to executable 'hello_world'. +Launching hello_world... +Hello, World +> +``` + +If you followed along so far: Congratulations! You're now up and running with C3. + + + + +