mirror of
https://github.com/Ed94/Odin.git
synced 2026-06-18 11:52:22 -07:00
Slices now have a capacity.
This commit is contained in:
+10
-8
@@ -8,15 +8,17 @@
|
||||
#import "strconv.odin";
|
||||
|
||||
main :: proc() {
|
||||
buf: [64]byte;
|
||||
// len := strconv.generic_ftoa(buf[..], 123.5431, 'f', 4, 64);
|
||||
x := 624.123;
|
||||
s := strconv.format_float(buf[..], x, 'f', 6, 64);
|
||||
fmt.println(s);
|
||||
fmt.printf("%3d\n", 102);
|
||||
// buf: [64]byte;
|
||||
// // len := strconv.generic_ftoa(buf[..], 123.5431, 'f', 4, 64);
|
||||
// x := 624.123;
|
||||
// s := strconv.format_float(buf[..], x, 'f', 6, 64);
|
||||
// fmt.println(s);
|
||||
// fmt.printf("%3d\n", 102);
|
||||
|
||||
a := [..]int{0, 1, 2, 3, 4, 5, 6};
|
||||
fmt.println(a[0..4]);
|
||||
a: [10]int;
|
||||
s := a[..0];
|
||||
append(s, 1, 2, 6, 3, 6, 5, 5, 5, 5, 1, 2);
|
||||
fmt.println(s);
|
||||
|
||||
|
||||
when false {
|
||||
|
||||
Reference in New Issue
Block a user