My C++ program needs to ask the user to input two values. In order to avoid non-integer values, I wanted to create a loop like this:
#include <iostream>
using namespace std;
int main(){
int x,y;
while ((typeof(x)!=int){
cin>>x;
cin>>y;
}
return 0;
}
However, it does not work. Does anyone know how to do it?