I have created class A in a.h and a.cpp,and class B in b.h and b.cpp;
One method of A needs B,like this,
class A
{
...
void method_A1(B b);
...
}
class A
{
...
void method_A1(B b);
...
}
To copy to clipboard, switch view to plain text mode
So the file b.h needs to be included in a.h.
now one method of B needs A,like this,
class B
{
...
void method_B1(A b);
...
}
class B
{
...
void method_B1(A b);
...
}
To copy to clipboard, switch view to plain text mode
So the file a.h needs to be included in b.h.
the program runs normally,but I think the two header files are included each other,it is odd.
Could you tell me how to deal with it normally?
Bookmarks