there is an
int a;
User enters a value but this value should be passed to a function that validates if the user entered an integer or if the user entered something else, without program crash.
cin.good()
will NOT work since it is the variable 'a' which I am passing to the function. Validation should take place inside the function
bool validateInteger(int a)
{
???
}
How to check if a is an integer or not?