头文件互相include的问题
---------------------------------
//hdr1.h
#ifndef hdr1_h
#define hdr1_h
#include "hdr2.h"
namespace NA
{
class CA
{
NB::CB b;
};
}
#endif
------------------------------------------
//hdr2.h
#ifndef hdr2_h
#define hdr2_h
#include "hdr1.h"
namespace NB
{
class CB
{
NA::CA a;
};
}
#endif
-------------------------------------------
#include "hdr1.h"
#include "hdr2.h"
int main()
{
NA::CA a;
NB::CB b;
}
-------------------------------------------
请问,该如何解决。