12345678910111213
void stringIsAnum(string &x, string prompt) { while (!is_digits(x = getInput(prompt))); } // calling this code string getInput(string prompt) { string x; cout << prompt << endl; cin >> x; return x; }
cerr << "Digits only please"<< endl;