Typeid behavior in c++
<p>Can someone explain to  me why this code prints Base , Derived but if i omit the f function from Base prints Base , Base ?</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;cstdio&gt;
using namespace std; 

class Base;
void testClassType (Base&amp; b);
class Base
{
 virtual void f(){};
};

class Derived :public Base
{
};

int main ()
{
 Base b;
 Derived d;
 testClassType(b);
 testClassType(d);

}
 void testClassType(Base&amp; b)
 {
  cout&lt;&lt;endl&lt;&lt;"It is:"&lt;&lt;typeid(b).name();
 }
</code></pre>
