I was wondering if there is a way that i could refuse a user's input if it was a float data type, or rather make the user's input strictly to integers? For example;
1 2 3 4 5 6 7 8 9
int x;
cout<<"enter a number: " <<endl;
cin >> x;
while(!(cin>>x))|| x < 0) // refuses char and negative
{ // how to also refuse float?
cout<<"Re-enter a number: "
cin>>x
}