質問です。
HogeA と HogeB の2つのクラスがあり
HogeA と HogeB が互いに所持しあうような場合
ファイルを分けるとしたらどのようにすればいいのでしょうか
以下のような書き方だとエラーになってしまいます
*********************************
FILE_A.h
*********************************
#ifndef HOGEA
#define HOGEA
#include "FILE_B.h"
class HogeA {
HogeB* m_pHogeB;
public:
HogeA() { m_pHogeB = new HogeB() }
}
#endif
*********************************
FILE_B.h
*********************************
#ifndef HOGEA
#define HOGEA
#include "FILE_A.h"
class HogeB {
HogeA* m_pHogeA;
public:
HogeB() { m_pHogeA = new HogeA() }
}
#endif