int and char issues

I have a question about errors Ive seen, while running my program, when using int and char.

int
If I input letters instead of a numbers my program goes crazy.

char
If I input a string of (example) 4 characters, my program return the default message 4 times.

I have sence refrained from using char, for user input, in my programs. But ints I really do need. Is there a way to avoid these run time errors?
post your code, so we can take a look!

and if you enter a letter in your int variable then it will give you its ASCI value
Last edited on
You can use exceptions to validate input
Topic archived. No new replies allowed.