Follow

I think I'm retarded. :pepega: Why doesn't argv register and why doesn't the while loop print the input string?

· · Web · 2 · 0 · 0
@matrix Got a pastebunn so I donât need to copy it by hand from an image?
@matrix printf() inside the while should probably be %c not %s, since it's a character, and not a string, that you're printing.

Also, why not use a "for" loop?

Did you make sure that "input_string" contains the data you want?
It's C, so you need to make sure any previous input isn't handed down.

What I mean by that is: sometimes when you press enter to input text, the next input gets the '\n' as the input, because it was still in there from the last input.
C is very annoying like that.
Sign in to participate in the conversation
Game Liberty Mastodon

Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.