Creating array of different objects
<p>I have this code, but I don't see where I went wrong here. It seem to compile OK but I cannot access <code>Computer</code> or <code>Appliance</code> functions. Can someone please help me understand how can I make an array that holds different objects on this code example I have here?</p>

<pre><code>#include &lt;iostream&gt;
using namespace std;

class Technics
{
private:
    int price, warranty;
    static int objCount;
    double pvn;
    char *name, *manufacturer;
public:
    Technics()
    {
        this-&gt;objCount++;
    };

    Technics(int price)
    {
        this-&gt;objCount++;
        this-&gt;price = price;
    }

    ~Technics(){
        this-&gt;objCount = this-&gt;objCount - 2;
    };

    static int getObjCount()
    {
        return objCount;
    }

    void setPrice(int price)
    {
        this-&gt;price = price;
    }

    int getPrice()
    {
        return this-&gt;price;
    }

    void resetCount()
    {
        this-&gt;objCount = 0;
    }
};
int Technics::objCount = 0;

class Computer : public Technics
{
private:
    int cpu, ram, psu, hdd;
public:
    Computer() {}
    Computer(int price)
    {
        this-&gt;setPrice(price);
    }

    void setCpu(int cpu)
    {
        this-&gt;cpu = cpu;
    }

    int getCpu()
    {
        return this-&gt;cpu;
    }
};

class Appliance : public Technics
{
private:
    int height;
    int width;
    char* color;
    char* type;

public:
    Appliance(){}
    Appliance(int height, int width)
    {
        this-&gt;height = height;
        this-&gt;width = width;
    }

    void setWidth(int width)
    {
        this-&gt;width = width;
    }

    int getWidth()
    {
        return this-&gt;width;
    }
};

void main()
{
    //Creating array
    Technics *_t[100];

    // Adding some objects
    _t[0] = new Computer();
    _t[1] = new Computer();
    _t[2] = new Appliance();

    // I can access only properties of Technics, not Computer or Appliance
    _t[0]-&gt;

    int x;
    cin &gt;&gt; x;
}
</code></pre>
