📅  最后修改于: 2022-03-11 14:44:58.394000             🧑  作者: Mango
if (typeid(variable) == typeid(std::string)) {
std::cout << variable << " is a string" << std::endl;
}
else {
std::cout << variable << " is not a string" << std::endl;
}//you can do this for every type