C++ Beginner - Limiting cin to integer or text only
Hi,
I have new to C++ programming. I would like to know how to define or limit the cin function so that it would only accept integer or text rather than anything.
I like to use the if statement and close the program if the user enters an invalid integer or text. For example:
if (blah != integer)
....blah...;
I have tried replacing "integer" with "int." That does not work. Is there anything I use put inplace of "integer" that would set it to either integer or text only? Thanks.
Kuphryn