In C++ if an integer value is expected,and the user enters a character,what value shall the variable actually take?
Code:int n; cout<<"n="; cin>>n;
And also,what sort of validation is it best to use?
For example,this won't work:
Code:int n; do cout<<"Enter a number:"; while(!(cin>>n));