// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <string>
#include <typeinfo>

using namespace std;

class MyClass
{
};

class MySubClass : public MyClass
{
};

int main()
{
   int i = 123;
   string s = "abc";
   MyClass *mc = new MyClass();
   MySubClass *msc = new MySubClass();
   MyClass *mcmsc = new MySubClass();
   cout << typeid(i).name() << endl;
   cout << typeid(s).name() << endl;
   cout << typeid(mc).name() << endl;
   cout << typeid(msc).name() << endl;
   cout << typeid(mcmsc).name() << endl;
   cout << typeid(*mc).name() << endl;
   cout << typeid(*msc).name() << endl;
   cout << typeid(*mcmsc).name() << endl;
   return 0;
}
