How to instantiate array of derived classes
<p>I am trying to set an array of base class and derived classes in another class. For example, I have base class:</p>

<pre><code>class Base{
public:
    Base() {};
    Base(float kv) : param(kv) {}
    ~Base() {};
    float getParam() { return param; }
    void setParam(bool kv) { param= kv; }
protected:
    float param;
};
</code></pre>

<p>and derived classes like:</p>

<pre><code>class Derived1: public Base{
public:
    Derived1() {};
    Derived1(float kv) : Base(kv) {}
    ~Derived1() {};
};
</code></pre>

<p>Now, in another class I have an array of Base type.</p>

<pre><code>class Hive{
public:
    Hive() {};
    Hive(...) : ... {}
    ~Hive() {};
    ...
    float getSomethingFromArray();

    ...
    void setB();
protected:
    ...
    Base *b[7];
};
</code></pre>

<p>Now, <code>setB()</code> instantiate array, like:</p>

<pre><code>b[0] = new Derived1();
</code></pre>

<p>but when I try to access method of b[0] it would't work. 
when I call method like:</p>

<pre><code>b[0].setParam(i);
</code></pre>

<p>Compiler reports this error</p>

<blockquote>
  <p>IntelliSense: expression must have class
  type  c:\users\miller\documents\visual studio
  2010\projects\hello\hello\objekat.h   139 2   hello</p>
</blockquote>
