check if a variable is tring c++
if (typeid(variable) == typeid(std::string)) { std::cout << variable << " is a string" << std::endl; } else { std::cout << variable << " is not a string" << std::endl; }
if (typeid(variable) == typeid(std::string)) { std::cout << variable << " is a string" << std::endl; } else { std::cout << variable << " is not a string" << std::endl; }