How to overcome circular dependence with declarations?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2503533/how-can-i-declare-classes-that-refer-to-each-other">How can I declare classes that refer to each other?</a>  </p>
</blockquote>



<p>Below is my code in a .h file. Compiler will complain about having SP object in CPattern. I can't place SP's declaration above CPattern as it's also declaring CPattern object in it. How do I solve this? Thank you for your help!</p>

<pre><code>class CPattern
{
public:
    CPattern(void);
    ~CPattern(void);

    SP &amp; Create(void);
};


class SP
{
private:
    const CPattern*    pPat;
public:
    SP()
    {
    }
    ~SP()
    {
        // pointer no longer requried
        delete pPat;
    }    
};
</code></pre>
