about summary refs log tree commit diff
path: root/examples/21.src
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-06-11 00:10:59 +0200
committerBaitinq <[email protected]>2025-06-11 00:11:01 +0200
commit8fd13680a7b87dc1a9ba2119666f7b0e26bc62b5 (patch)
tree80e8e9319734e112558f1a9c31485b1c01bccb41 /examples/21.src
parentBoostrap: fix aarch64 linking (diff)
downloadinterpreter-8fd13680a7b87dc1a9ba2119666f7b0e26bc62b5.tar.gz
interpreter-8fd13680a7b87dc1a9ba2119666f7b0e26bc62b5.tar.bz2
interpreter-8fd13680a7b87dc1a9ba2119666f7b0e26bc62b5.zip
stdlib: Remove println
varargs forwarding is platform specific with llvm, so we cannot easily
have this function
Diffstat (limited to 'examples/21.src')
-rw-r--r--examples/21.src6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/21.src b/examples/21.src
index fbc4d3a..804b242 100644
--- a/examples/21.src
+++ b/examples/21.src
@@ -16,7 +16,7 @@ let init_array = (n: i64, arr: *i64) => void {
 let print_array = (n: i64, arr: *i64) => void {
 	let i = 0;
 	while i < n {
-		println("%d", *(arr + cast(*i64, i)));
+		printf("%d\n", *(arr + cast(*i64, i)));
 		i = i + 1;
 	};
 	return;
@@ -51,12 +51,12 @@ let main = () => i64 {
 	let arr = cast(*i64, malloc(n * 8));
 	init_array(n, arr);
 
-	println("Pre-sorted:");
+	printf("Pre-sorted:\n");
 	print_array(n, arr);
 
 	sort_array(n, arr);
 
-	println("Sorted:");
+	printf("Sorted:\n");
 	print_array(n, arr);
 	
 	free(cast(*void, arr));