Check data type input!!

Please support our C advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Feb 2006
Posts: 2
Reputation: thinhbk1802 is an unknown quantity at this point 
Solved Threads: 0
thinhbk1802 thinhbk1802 is offline Offline
Newbie Poster

Check data type input!!

 
0
  #1
Feb 27th, 2006
Well, I have a small problem with checking the data type input by user. I want to make sure that the data got from keyboard must be "int" type. If User gives us another data types such as "char", "float, etc the program should report an error!!! :!:
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,266
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 377
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: Check data type input!!

 
-1
  #2
Feb 27th, 2006
Originally Posted by thinhbk1802
Well, I have a small problem with checking the data type input by user. I want to make sure that the data got from keyboard must be "int" type. If User gives us another data types such as "char", "float, etc the program should report an error!!! :!:
Before you pass it onto the next stage make sure the input doesn't contain anything but numbers from 0-9.

Write your own function or adapt one already in the c library.
*Voted best profile in the world*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC