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!

C++ keyboard error checking

Status
Not open for further replies.

cooldude69

Technical User
Aug 14, 2000
3
GB
I am currently writing a mathematical C++ program, and have become stuck at a vitalpoint. I dont no how to perform a keyboard error check which will except numbers, and refuse characters without going into a infinite loop.I also want the program to ask the user to re-enter the data if a illegal character is entered. I am fairly new toto C++ and would appreciate any help.
 
&nbsp;&nbsp;&nbsp;&nbsp;There are several ways to do this. Show us the code that you are stuck on (a small snippet please).<br> <p>James P. Cottingham<br><a href=mailto: > </a><br><a href= Veneer Co., Inc.</a><br>All opinions are mine alone and do not necessarily reflect those of my employer.
 
please forgive me if this code is a little messy but here is a small part of my program.<br><br>calculation()<br>{<br><br>&nbsp;&nbsp;&nbsp;&nbsp;do<br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clrscr();<br><br> cout&lt;&lt;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top