944,001 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 8783
  • C RSS
Feb 27th, 2006
0

Check data type input!!

Expand Post »
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!!! :!:
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
thinhbk1802 is offline Offline
2 posts
since Feb 2006
Feb 27th, 2006
-1

Re: Check data type input!!

Quote 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.
Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Pointer logic advice
Next Thread in C Forum Timeline: Drawing bitmap on window - how to clear window/HDC?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC