Accessing Public Class Function in Private Class Giving Error
<pre><code>class test
{
private:
    class privateStruct
    {
    public:
        int m;
        privateStruct(int p){m=p;}
    };
};

void ff()
{
    test::privateStruct ps(4);
    throw ps; //Does not work.. 
}

void main()
{
    try
    {
        ff();
    }
    catch(...)
    {
    }
}
</code></pre>

<p>But the Following Code Works Why</p>

<pre><code>class test
{
private:
    class privateStruct
    {
    public:
        int m;
        privateStruct(int p){m=p;}
    };
};

void ff()
{
    throw test::privateStruct(4); //Work why
}

void main()
{
    try
    {
        ff();
    }
    catch(...)
    {
    }
}
</code></pre>

<p><strong>NOTE : I am using VC++ 6.</strong></p>

<p>I need answer why the above code works.</p>

<p>Thanks in Advance :)</p>
