I'm having problems validating my input values.
To ensure only numeric input i did:
However if i loop it and clear the buffer:
cout<<"Please enter a number: ";
In the first case if i enter any int it is expected and displayed as an int.
cout<<"Please enter your choice: ";
while(i<1 || i>9 || !cin.good())
cout<<"\aInput Error. Please make a valid choice: ";
However in the second case
if i enter 08 instead of 8 or 09 instead of 9,
it only accepts the 0, in some cases it acceepts 010 as an octal value, and displays it at a later stage as 8.
Is there any other way i can clear the buffer.
Any help in resolving this problem will be appriciated.