Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
How to pass in a readable file (stream) to a Zig function?
Most of the example code in the Zig online docs is in the form of test blocks. Sadly, this means there aren't quite enough examples of how to write functions.
Given that one has a readable file, possibly including stdin
, what is the "ziggy" way to pass that to a function that will read input from it?
Should I pass a pointer? A copy? A reader? A pointer to a reader?
I recently watched Loris Cro's video on pointers/slices/const/etc. so I sort of understand that there might be some trickery, but I don't know Zig well enough to guess what the trickery might be.
0 comment threads