I have a requirment that accepts values from user input. It can be integers or strings. User input is accepted as below.
string strArg;
cout << "Enter price value " << endl;
std::getline(std::cin, strArg);
int input;
std::stringstream(strArg) >> input;
Question is how do i check user has entered integer, rather than string, i.e., check for right input. How can we do this in portable way in C++? As in my project Boost is not allowed as my manager is not happy in using it:)