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?

  • Did you use GetInt() to get the input?
    – wallek876
    Commented Jan 13, 2015 at 11:05

1 Answer 1


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

  • How is GetInt() different from scanf if i'm providing the format specifier for integer. Commented Jan 17, 2015 at 13:47

You must log in to answer this question.

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