title: Creating an array of pointers of derivative class objects. C++. Abstract base class
body: <p>I need to make an array of 100 pointers to objects of two classes that are derived from an abstract class.</p>
  
  <p>First element of array is of <code>class B</code>, second is <code>C</code>, third is <code>B</code> etc.</p>
  
  <p><code>A</code> is base and abstract class at the same time.</p>
  
  <p>For example:</p>
  
  <pre><code>class A
  {
   public:
     A();
     virtual double pureVirtualMethod() = 0;
  };
  
  class B: public A
  {
  };
  class C: public A
  {
  };
  </code></pre>
  
  <p>In <code>main()</code> I need to make an array of pointers that will point to any of the derived classes.</p>
  
  <p>I can't use Stl or Boost.</p>