title: FAQ: Why does dynamic_cast only work if a class has at least 1 virtual method?
body: <p>This does not compile in C++:</p>
  
  <pre><code>class A
  {
  };
  
  class B : public A
  {
  };
  
  ...
  
  A *a = new B();
  B *b = dynamic_cast&lt;B*&gt;(a);
  </code></pre>