This is the first exercise in the AOC
The console prints the later part of the formatted string plus garbage??
-> 9984zbjbznsqtj
-> 999fhnmvqsoneninezbrzcqkz4ftv
1eightcrcjcbdthreebscfpvznqfrj6 -> 1000
I'm expecting it to print
eightbqfhnmvqsoneninezbrzcqkz4ftv -> 999
1eightcrcjcbdthreebscfpvznqfrj6 -> 1000
pub fn main() !void {
const allocator = std.heap.page_allocator;
const max_size = std.math.maxInt(usize);
const data = try std.fs.cwd().readFileAlloc(allocator, "./input/01.txt", max_size);
defer allocator.free(data);
var iter = std.mem.splitScalar(u8, data, '\n');
var i: u32 = 0;
while (iter.next()) |line| {
i += 1;
std.debug.print("{s} -> {d}\n", .{ line, i });
//std.debug.print("{s}\n", .{line}); // prints as expected
//std.debug.print("{}\n", .{i}); // prints as expected
}
}