c++ redefine a class
<p>I would like to redefine a class in c++ (non clr). Here's the reason</p>

<pre><code>class BabyClass
{
    public:
        string Name;
        int getSiblings(MainClass &amp;mclass)
        {
            int c = mclass.size();
            for(int i=c;i&gt;0;--i)
            {
                if(mclass.at(i).Name != Name)
                    cout &lt;&lt; mclass.at(i).Name;
            }
        }
}
class MainClass
{
    public:
       vector&lt;BabyClass&gt; babies;
}
</code></pre>

<p>now of course this isn't my real code, but I think you can see the problem.
I want my baby class to have access to the main class, the problem is at compile time it doesn't know the MainClass exists, so to fix it normally I would put the MainClass above the BabyClass, but if I do that I can't have a vector of BabyClass's because the compiler wouldn't know about the BabyClass.
I know with functions you can do something like</p>

<pre><code>int function(string hello);
</code></pre>

<p>then later</p>

<pre><code>int function(string hello)
{
    code
}
</code></pre>

<p>or use virtual functions and such. Any idea's how I would do this with classes? Thanks.</p>

<p><strong>And by the way</strong>, I know someone is going to ask if it's really necessary, so yes, it is.</p>
