Jul 22, 2007 #1 D 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....
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....
Jul 22, 2007 #2 A A.Anand Srinivasan Advanced Member level 5 Joined Oct 15, 2005 Messages 1,792 Helped 257 Reputation 514 Reaction score 39 Trophy points 1,328 Location India Activity points 10,678 refer this link.... http://www.gidnetwork.com/b-63.html it has detailed listing of what all problems arise due to scanf and ways of avoiding them.....
refer this link.... http://www.gidnetwork.com/b-63.html it has detailed listing of what all problems arise due to scanf and ways of avoiding them.....