string example

This commit is contained in:
2025-06-01 17:30:26 +02:00
parent 35f0823432
commit 781280060c
12 changed files with 47 additions and 38 deletions

12
examples/strings.zr Normal file
View File

@@ -0,0 +1,12 @@
func print_i64[x: I64] : I64
printf("%ld\n", x)
func i64_to_string[n: I64] : String
let x: I64 = malloc(21)
sprintf(x, "%d", n)
return x
func main[] : I64
let s: String = i64_to_string(58394)
print_i64(strlen(s))
free(s)