How to check the type name of an object in derived classes?
<p>This is my code:</p>

<pre><code>class Base { /* something */ };
class Derived : public Base { /* something */ };
vector&lt;Base*&gt; v; // somebody else initializes it, somewhere
int counter = 0; 
for (vector&lt;Base*&gt;::iterator i=v.begin(); i!=v.end(); ++i) {
  if (typeof(*i) == "Derived") { // this line is NOT correct
    counter++;
  }
}
cout &lt;&lt; "Found " &lt;&lt; counter &lt;&lt; " derived classes";
</code></pre>

<p>One line in the code is NOT correct. How should I write it properly? Many thanks in advance!</p>
