to check for mixed input

suppose i take an int type variable and give input in that which is mix of int as well as char type. so which function should be used to determine that the given input is not of the desired data type.
please help me more
i am just a beginner in c.
I don't know what you are asking.

Just guessing your problem, before assigning, check the ascii value and decide accordingly on what needs to be done.

char c;   //lets say, some value already assigned to c
if(c > '0' || c < '9')
printf("%c is not a integer character", c);

Last edited on
Topic archived. No new replies allowed.