question for any C++ progammers

トップ ページ
添付ファイル:
Eメールのメッセージ
+ (text/plain)
このメッセージを削除
このメッセージに返信
著者: Furmanek, Greg
日付:  
題目: 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