Possible Duplicate:
How can I declare classes that refer to each other?
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!
class CPattern
{
public:
CPattern(void);
~CPattern(void);
SP & Create(void);
};
class SP
{
private:
const CPattern* pPat;
public:
SP()
{
}
~SP()
{
// pointer no longer requried
delete pPat;
}
};