Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input validation 1

Status
Not open for further replies.

BigBri

Programmer
Oct 28, 1999
3
CA
To pick up a char or string value when it is entered into a float or int before it crashs the program? then kick it out and get new input<br>Any ideas!!
 
Your best bet is to pick up the input as a string then do a conversion using something like strtod(cont char s*, char **endptr), atof(const char *s), or even printf. It's going to depend on wether you use stings or an array of characters. I personnally prefer to use strings and atof or atoi.<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top