Base Class method accessing Derived Class members
<p>I have following scenario :</p>

<pre><code>class num {
    public:
    void print(ostream* o); // Prints the n variable
};

class int_num : public num{
    public:
    int n; // Initialized by this class's constructor
};

class float_num : public num{
    public:
    float n; // Initialized by this class's constructor
};

class double_num : public num{
    public:
    double n; // Initialized by this class's constructor
};
</code></pre>

<p>How do I implement such a scheme </p>
