2008-06-01から1日間の記事一覧

【C++】ヘッダーの相互参照

C++

ヘッダーの相互参照の問題 c++で以下のようにclass Aとclass Bでお互い参照したいときには、以下のように書くはず。 #ifndef _A_H_ #define _A_H_ #include "B.h" class A{ B* b; } #ifndef _B_H_ #define _B_H_ #include "A.h" class B{ A* a; } ところが、…