title: Declaring an extern variable as base and derived class pointers
body: <p>Say we have a situation like this:</p>
  
  <p>base.h:</p>
  
  <pre><code>class Base { };
  </code></pre>
  
  <p>derived.h:</p>
  
  <pre><code>#include "base.h"
  class Derived : public Base { };
  extern Derived *variable;
  </code></pre>
  
  <p>derived.cpp:</p>
  
  <pre><code>#include "derived.h"
  Derived *variable; 
  </code></pre>
  
  <p>Is it correct to declare <code>variable</code> as a pointer to <code>Base</code> in elsewhere.cpp?</p>
  
  <pre><code>class Base;
  extern Base *variable;
  </code></pre>
  
  <p>The C++Builder linker doesn't complain and everything seems to work. Is this safe and correct according to the standard, or should every declaration of <code>variable</code>be of the same type?</p>