cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
im having trouble verifying an alpha num
im having trouble verifying an alpha numeric input...
Aug 26, 2012 at 4:32am UTC
maculhet
(30)
my program needs to ask for a number and when the input is alphabet it will say invalid input, but when the input is is alphanumeric it still accept it. how can i validate an alphanumeric input?
Aug 26, 2012 at 4:51am UTC
maculhet
(30)
cout<<"Enter Transmission | ";
cin>>num;
while(!cin)
{
cout<<"Invalid Input! Try Again! |\n";
cin.clear();
cin.ignore();
cin>>num;
}
result+=num;
this is a sample of my syntax for my program
Topic archived. No new replies allowed.