SyntaxFix
Write A Post
Hire A Developer
Questions
Here is another solution.
try { (void) std::stoi(myString); //cast to void to ignore the return value //Success! myString contained an integer } catch (const std::logic_error &e) { //Failure! myString did not contain an integer }