fork download
  1. #include <typeinfo>
  2. #include <iostream>
  3. #include <string>
  4.  
  5. class Foo { };
  6.  
  7. int main() {
  8. Foo foo;
  9. std::string strType = typeid(foo).name();
  10.  
  11. std::cout << strType << std::endl;
  12. }
Success #stdin #stdout 0s 3272KB
stdin
Standard input is empty
stdout
3Foo