[IOT-459] Notification Manager Sample consumer and provider app doesnot handle invalid menu option properly
Change-Id: Ibabe15fe2c6192817b4216a0050cb8711767700e
Signed-off-by: jyong2.kim <jyong2.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/855
Reviewed-by: Uze Choi <uzchoi@samsung.com>
Tested-by: Uze Choi <uzchoi@samsung.com>
cout << "========================================================" << endl;
cin >> number;
+ if(std::cin.fail())
+ {
+ std::cin.clear();
+ std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
+ std::cout << "Invalid input type, please try again" << std::endl;
+ continue;
+ }
switch (number)
{