|
-
Jan 3rd, 2002, 02:33 AM
#1
Thread Starter
Hyperactive Member
How to validate cin input?
Now I am making transition from C to C++.
In the past using C, I validated by using getchar or gets, then I validated them.
For example, the input is supposed to be integer, I will check the string for any non-numeric char, if no, I will convert it to int.
Now I was writing a program using cout and getchar. It compiles alright and links alright but it hangs after cout and not getting any input from me. ????
I have changed all to cin as I am the only one who use the program so I can't enter any invalid input, given the fact the program is written by me too.
Given the scenario, the program's end user is not me, how do I verify?
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|