#include <iostream>
#include <string>
bool isNumeric(std::string const &str) {
char* p;
strtol(str.c_str(), &p, 10);
return *p == 0;
}
int main() {
std::string str = "1284";
std::cout << std::boolalpha << isNumeric(str) << "\n";
std::cout << std::boolalpha << isNumeric("-3") << "\n";
}
/*
run:
true
true
*/