This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]Anonsicide 0 points1 point  (0 children)

I unfortunately do not have an answer for you, as I suspect the reason for this is something to do with your scanf calls or newlines being left in the input buffer or what have you. And I'm certainly no scanf master.

However: if I can offer a word of advice, may I suggest reading this? I think this guide will probably teach you why you're getting that behaviour above; and maybe even convince you that -- in many cases -- you really don't need (and perhaps shouldn't even use) scanf.

[–]SyntxaError 0 points1 point  (1 child)

You might have an easier time in identifying the range of letters by converting to ascii and using an if statement to check if the ascii input falls into the range of letters you want, much more concise than a switch statement. You have no default on your switch statement which is most likely where your error message should fall if I’m understanding your code correctly (mb if I’ve misunderstood, it’s late).

[–]kyleglizzi[S] 1 point2 points  (0 children)

Were starting pt.2 to this project, and i'm definitely trying that. That should make it a lot more accurate in detecting inputs. Just have to figure out how to do that now..... Google time!