#include <typeinfo>
...
cout << typeid(variable).name() << 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;
}//you can do this for every type
int k;
cout << typeid(k).name() << endl;
Code Example |
---|
Cpp :: c++ file is empty |
Cpp :: c++ find minimum value in vector |
Cpp :: how to print items in arduino |
Cpp :: lpcwstr to string c++ |
Cpp :: sleep in cpp |
Cpp :: how to convert qt string to string |
Cpp :: rng c++ |
Cpp :: c++ string erase all occurrences |
Cpp :: c++ custom compare in set |
Cpp :: input output c++ |
Cpp :: how to sort in descending order c++ |
Cpp :: c++ set console title |
Cpp :: how to run code in devcpp |
Cpp :: ue4 c++ array |
Cpp :: basic symbol meanings in c++ |
Cpp :: print linkedstack cpp |
Cpp :: ue4 ftext to int |
Cpp :: creator of C++ |
Cpp :: rotate in cpp |
Cpp :: eosio name to string |
Cpp :: xmake set binary name |
Cpp :: PI IN C++ WITH CMATH |
Cpp :: freopen c++ |
Cpp :: print linked list recursively c++ |
Cpp :: c++ show current time |
Cpp :: c++ char array to int |
Cpp :: opencv c++ hello world |
Cpp :: how to convert int to string c++ |
Cpp :: find last occurrence of character in string c++ |
Cpp :: multiline comment in c++ |