Input error detection

Status
Not open for further replies.

danesh

Full Member level 3
Joined
Nov 24, 2003
Messages
184
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
1,343
Hi guys,

hw to write a error detection code for condition where a variable is declared as int and user inputed mayb a non integer input ie. char

for example :

int b;
printf ("enter num!\n");
scanf("%ld",&b);

hw do we write a code so error msg could be flaged whenever user input non int values.

thanks....
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…