123456
int myint = 0; if(std::cin >> myint) { std::cout << "it's an integer"; } else { std::cout << "it's not"; }