Error: Incomplete Type Class

Write the two classes A and B into Ah and Bh respectively. Error: Incomplete Type Class appears when compiling.
IDE: Code:: Blocks
Compiler: GCC
writes the two classes A and B to Ah and Bh respectively
. The content is as follows:
#include “Bh”
Class B;//Forward declaration
Class A
{ void use(B *b) } The content of Bh is as follows: #include “Ah” Class A;//Forward declaration Class B { void use (A *a) } Error: Incomplete Type Class will appear when compiling. Solution: Write A and B in the same header file










Guess you like

Origin blog.csdn.net/shiaiao/article/details/92218090