#Easy parser?

1 messages · Page 1 of 1 (latest)

azure stream
#

I just started Advent of Code 2024 and i need an easy way to parse files, kinda like c's fscanf. Is there something similar for Zig? Thanks.

cunning wedge
#

std.mem.tokenizeAny into std.fmt.parseInt is quite easy.

hushed plover
#

No. In Zig things are more separate parts, and not kitchen sinks like fscanf. You read the data into a buffer, then parse the data (e.g. std.fmt.parseFloat, parseInt*).