0

I have done the mario.c prg, it works, but there a small bug. I have put a check for numbers between 0 and 23, but what if user enters an alphabet or a special character. In that case my terminal goes in a infinite loop in which it keeps printing Height without asking for a input. I have used while(height<0 || height>23); I was thinking of including alphabets and symbols using ASCII code but unable to compare height with a alphabet or symbol..

Any one having the same issue?

1
  • Did you use GetInt() to get the input? – wallek876 Jan 13 '15 at 11:05
2

No need to do that. If you are using GetInt(); to accept input, symbols and alphabet letter will not be accepted.

1
  • How is GetInt() different from scanf if i'm providing the format specifier for integer. – Prateek Pande Jan 17 '15 at 13:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .