How can I restrict the user to input real numbers only in C++ program?
Example:
double number; cin >> number;
and it won\'t accept t
double number if (cin >> number) { do_stuff_with(number); } else { std::cerr << "That wasn't a number!"; }