How do I check for a blank entry for numerical input in a C++ program? For example, if my input variable is Qty (an int), how do I check to see if the user simply presses Enter without keying in a value for Qty?
Printable View
How do I check for a blank entry for numerical input in a C++ program? For example, if my input variable is Qty (an int), how do I check to see if the user simply presses Enter without keying in a value for Qty?
It is checked already with "cin". It will '\n' it until a valid data is inputted.
----------------
Engineer223