I'm writing a program that only accepts int for user input at this point, if its not, keep asking user until get the right integer. Here is the code below:
cout << "enter two integers: " << endl;
string input1, input2;
cin >> input1;
cin >> input2;
while (//if they are not integers)
...//ask again
As you can see, I use string to store the input, but I don't know how to check this string contains only an integer number.