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.