About pointer downcasts/inheritance
<p>So I'm about finishing up prata's C++ primer and I'm u to RTTI. He showed a line of downcasting and just said it's wrong but I want to see a better example. </p>

<pre><code>class Grand
{
private:
    int hold;
public:
    Grand(int h=0) : hold(h) {}
    virtual void Speak() const { cout &lt;&lt; "I am a grand class\n";}
    virtual int Value() const {return hold; }
    void Gah() const {cout &lt;&lt; "ok" &lt;&lt; endl;}
};

class Superb : public Grand
{
public:
    Superb(int h = 0) : Grand(h){}
    void Speak() const {cout &lt;&lt; "I am a superb class!!\n";}
    virtual void Say() const
    { cout &lt;&lt; "I hold the superb value of " &lt;&lt; Value() &lt;&lt; "!\n";}
    void Sah() const { cout &lt;&lt; "Noak" &lt;&lt; endl;}
};

class Magnificent : public Superb
{
private:
    char ch;
public:
    int hour;
    Magnificent(int h = 0, char c = 'A') : Superb (h), ch(c){}
    void Speak() const {cout &lt;&lt; "I am a magnificent class!!!\n";}
    void Say() const {cout &lt;&lt; "I hold the character " &lt;&lt; ch &lt;&lt;
        "and the integer " &lt;&lt; Value() &lt;&lt; "!\n";}
    void Mah() const {cout &lt;&lt; "Ok" &lt;&lt; endl;}
};


Grand * GetOne();

int _tmain(int argc, _TCHAR* argv[])
{
    /*
    srand(time(0));
    Grand * pg;
    Superb * ps;
    */

    Grand * pg = new Grand;
    Grand * ps = new Superb;
    Grand * pm = new Magnificent;

    Magnificent * ps2 = (Magnificent *)pg;

    ps2-&gt;Gah();

    cout &lt;&lt; ps2-&gt;hour &lt;&lt; endl;

    system("pause");
}
</code></pre>

<p>So above, I'm casting a base to a derived which is overall not to be done. However, in this example, what am I really limited to? When I am casting pg, I still have access through ps2 to all of the grand/superb/magnificent properties and methods. In other words, nothing fails here. Can anyone give me an example or add something to the code which will clearly show to me how assigning a base to a derived can mess things up?</p>
