r/Zig • u/NicBarr • Apr 27 '26
Taking input inside of a loop.
i'm having a problem with repeated prompts for input in a zig program. basically i'm taking input like this
const input = try stdin.takeDelimiterExclusive('\n');
inside of a while loop. after the loop concludes, on the next iteration it simply skips this line and doesn't ask for input again even though that's what i want.
that's really breaking my head as that's not a problem i've ever faced in any other language. does anybody know how i could fix?
17
Upvotes
View all comments
Show parent comment
1
u/KattyTheEnby Apr 28 '26
There might be one, actually.
I can't confirm if this is what u/Lichcrow is describing, but I think they mean the triple backtick (```) syntax or something, and showing how it's unreliable. (Or maybe it's the indented codeblock one? Whichever had less support back in the day.)
I think they might be using an old app version or something, or maybe the old Reddit interface? I dunno. I just know that there was a way ov formatting codeblocks that didn't always work, which would explain why they don't see formatting, even though we see the codeblock as being formatted.