In main()
say you have something like this:
How would you go about checking if what the user entered is an integer? If the user not entered an integer, then repromt the user. how would one do this? I've tried coverting to ASCII, but that doesn't seem to help.Code:int main(){ int a; cout << "enter an integer: " ; cin >> a; CheckIfInt(a); return 0; } void CheckIfInt(int b) { /// ????? }