I trying something really simple but in same time a little bit hard for me. I want to let user to insert number via console and if is not number to tell that is not and give chance to insert again while is number. Here is what I've made so far
int a;
cout<<"enter a: ";
cin>>a;
while (!isdigit(a)); {
cout << "\n ERROR, enter a number" ;
cin.clear();
cin >> a;
}
system("Pause");
return 0;
Now I get error that is not number but the program is terminate. I can't insert again and must start it again.