question for any C++ progammers

Páxina inicial
Anexos:
Mensaxe orixinal
+ (text/plain)
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Furmanek, Greg
Data:  
Asunto: question for any C++ progammers
-> I am pretty new to C++, compiling, etc., I really want to learn this
-> stuff... I am trying to figure out how to validate input
-> from a user to
-> make it accept only positive numeric values. I was using a
-> while loop to
-> check it, but when the user enters an alpha character, I get
-> stuck in the
-> loop of death, I am sure many of you have experienced this.
-> I asked my
-> instructor how to do this, but he said that he wasn't sure.
-> would an if
-> statement nested in a while loop solve my problem??

I think this question is more for the dev list but ....

Try reading up on isdigit.
'man isdigit'
this should help

The Wolf